Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PXXDPT

PXXDPT.m

Go to the documentation of this file.
  1. PXXDPT ;ISL/DLT - Synchronize Patient File (2) and IHS Patient File (#9000001) ;05/15/2018
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**1,211**;Aug 12, 1996;Build 454
  1. ;;1.0;PCE Patient/IHS Subset;;Nov 01, 1994
  1. ;
  1. SETSSN ; Entry Point from PX09 cross-reference on File 2, field .09
  1. ;to define patient entry in 9000001.
  1. D CHECK Q:'$T
  1. EN Q:PX=""
  1. ;DA is the DFN and PX is the SSN.
  1. ;If the patient entry already exists quit.
  1. I $D(^AUPNPAT(DA,0)) Q
  1. N FDA,FDAIEN,MSG,PXXLOC
  1. S PXXLOC=+$P($G(^PX(815,1,"PXPT")),"^",1)
  1. I PXXLOC=0 S PXXLOC=$P($$SITE^VASITE,U,1)
  1. S FDAIEN(1)=DA,FDAIEN(2)=PXXLOC
  1. S FDA(9000001,"+1,",.01)=DA
  1. S FDA(9000001.41,"+2,+1,",.01)=PXXLOC
  1. S FDA(9000001.41,"+2,+1,",.02)=PX
  1. D UPDATE^DIE("","FDA","FDAIEN","MSG")
  1. I $D(MSG) D
  1. . D EN^DDIOL("Could not create the PATIENT/IHS entry, due to the following error:")
  1. . D AWRITE^PXUTIL("MSG")
  1. Q
  1. ;
  1. KILLSSN ;Entry point from PX09 cross-reference on File 2, field .09 to kill SSN
  1. ;information from 9000001.
  1. D CHECK Q:'$T
  1. N DFN S DFN=+DA N DA,X
  1. S X=PX,DA(1)=DFN,DA=$P($G(^PX(815,1,"PXPT")),"^",1) Q:'+DA X ^DD(9000001.41,.02,1,1,2)
  1. Q
  1. ;
  1. CHECK ;Check for appropriate variables and globals defined before proceeding
  1. I $D(^AUPNPAT),$G(DA),$D(^DPT(DA))
  1. Q
  1. ;
  1. LOAD ;Logic to use during install to initially load ^AUPNPAT(
  1. S PXFG=0
  1. S DA=+$P($G(^PX(815,1,"PXPT")),"^",2)
  1. F S DA=$O(^DPT(DA)) Q:'DA Q:PXFG=1 S PX=$P($G(^DPT(DA,0)),"^",9) D SETSSN D
  1. .S $P(^PX(815,1,"PXPT"),"^",2)=DA
  1. .I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,PXFG=1
  1. I PXFG'=1 S $P(^PX(815,1,"PXPT"),"^",2)=0
  1. K DR,DIE,DA,PXDA,PXFG
  1. Q