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