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

DG53665O.m

Go to the documentation of this file.
  1. DG53665O ;ALB/BRM,LBD;DG*5.3*665 PRE-INSTALL ; 5/23/05 10:22am
  1. ;;5.3;Registration;**665,1015**;Aug 13,1993;Build 21
  1. ;;
  1. ; This pre-install routine will transmit all Korean DMZ Agent Orange
  1. ; veterans to the HEC.
  1. ;
  1. AOQUE ; Que job to run
  1. N ZTRTN,ZTDESC,ZTSAVE,ZTSK,ZTDTH,ZTQUEUED,ZTIO
  1. ;
  1. D BMES^XPDUTL(" This process will find all Agent Orange Veterans who have")
  1. D MES^XPDUTL(" an Agent Orange Location of Korean DMZ and transmit them to")
  1. D MES^XPDUTL(" the Health Eligibility Center.")
  1. D MES^XPDUTL(" ")
  1. ;
  1. S ZTRTN="FIND^DG53665O",ZTIO="",ZTDTH=$$NOW^XLFDT()
  1. S ZTDESC="DG*5.3*665 PRE-INSTALL PROCESS"
  1. D ^%ZTLOAD,HOME^%ZIS
  1. I '$G(ZTSK) D BMES^XPDUTL("Pre-install process was not tasked.") Q
  1. D BMES^XPDUTL("Pre-install process has been tasked as Task #"_ZTSK)
  1. Q
  1. ;
  1. FIND ; entry point
  1. ;
  1. N DFN,X1,X2,X
  1. ;
  1. K ^XTMP("DG53665O")
  1. S X1=DT,X2=90 D C^%DTC
  1. S ^XTMP("DG53665O",0)=X_"^"_$$NOW^XLFDT_"^DG*5.3*665 PRE-INSTALL"
  1. S ^XTMP("DG53665O",0,"TASK")=$G(ZTSK)
  1. ;
  1. S DFN=0
  1. F S DFN=$O(^DPT(DFN)) Q:'DFN D
  1. .S ^XTMP("DG53665O","TCNT")=$G(^XTMP("DG53665O","TCNT"))+1
  1. .;
  1. .; quit if patient is deceased
  1. .Q:$P($G(^DPT(DFN,.35)),"^")
  1. .; quit - patient does not have the AO Exposure Indicator set to 'YES'
  1. .Q:$P($G(^DPT(DFN,.321)),"^",2)'="Y"
  1. .; quit if the patient does not show 'Korean DMZ' as the AO Location
  1. .Q:$P($G(^DPT(DFN,.321)),"^",13)'="K"
  1. .; process HL7 transmission
  1. .D EVENT^IVMPLOG(DFN)
  1. .S ^XTMP("DG53665O","DATA",DFN)=""
  1. .S ^XTMP("DG53665O","CNT")=$G(^XTMP("DG53665O","CNT"))+1
  1. .Q
  1. ;
  1. S $P(^XTMP("DG53665O",0),"^",4)=$$NOW^XLFDT
  1. ;
  1. ; send message for AO job
  1. D SNDMSG
  1. Q
  1. ;
  1. ;
  1. SNDMSG ; Send Mailman bulletin when process completes
  1. N SITE,STATN,SITENM,XMDUZ,XMSUB,XMY,XMTEXT,MSG
  1. S SITE=$$SITE^VASITE,STATN=$P($G(SITE),U,3),SITENM=$P($G(SITE),U,2)
  1. S:$$GET1^DIQ(869.3,"1,",.03,"I")'="P" STATN=STATN_" [TEST]"
  1. S XMDUZ="AO-KOREAN DMZ TRANSMISSION JOB",XMSUB=XMDUZ_" - "_STATN
  1. S XMY(DUZ)=""
  1. S XMTEXT="MSG("
  1. S MSG(1)="The Agent Orange Korean DMZ transmission process has completed successfully."
  1. S MSG(2)="This process searched for patient records with an Agent Orange Exposure"
  1. S MSG(3)="Location of Korean DMZ, and queued the record for a Z07 transmission to"
  1. S MSG(4)="the Health Eligibility Center. "
  1. S MSG(4.5)=""
  1. S MSG(5)="Task: "_$G(^XTMP("DG53665O",0,"TASK"))
  1. S MSG(6)="Site Station Number: "_STATN
  1. S MSG(7)="Site Name: "_SITENM
  1. S MSG(8)=""
  1. S MSG(9)="Process started : "_$$FMTE^XLFDT($P($G(^XTMP("DG53665O",0)),U,2))
  1. S MSG(10)="Process completed : "_$$FMTE^XLFDT($P($G(^XTMP("DG53665O",0)),"^",4))
  1. S MSG(10.5)=""
  1. S MSG(11)="Total Patients processed : "_+$G(^XTMP("DG53665O","TCNT"))
  1. S MSG(12)="AO Korean DMZ rec. queued for transmission : "_+$G(^XTMP("DG53665O","CNT"))
  1. S MSG(12.5)=""
  1. S MSG(13)="For identification of the patients for whom the AO Korean DMZ job"
  1. S MSG(14)=" sent a record to HEC, you can review the following global:"
  1. S MSG(15)=" ^XTMP(""DG53665O"",""DATA"",DFN)"
  1. S MSG(16)=" DFN = internal entry number of the Patient file (#2)."
  1. D ^XMD
  1. Q