DG531011P ;OIT/KCL - PRE-INSTALL ROUTINE FOR DG*5.3*1011 ;3/27/2020
;;5.3;Registration;**1011**;Aug 13,1993;Build 4
;
;no direct entry
Q
;
EP ;Entry Point
;
D STORE
;
Q
;
STORE ;Store patients with HURRICANE KATRINA indicator in ^XTMP global, then delete from patient record
;
D BMES^XPDUTL(">>> Store patients (DFNs) with HURRICANE KATRINA indicator in")
D MES^XPDUTL(" ^XTMP(""DG531011P"") global and delete indicator from the")
D MES^XPDUTL(" EMERGENCY RESPONSE INDICATOR (#.181) field of those records")
D MES^XPDUTL(" in PATIENT (#2) file.")
;
;quit if patch already installed and ^XTMP exists
I $$PATCH^XPDUTL("DG*5.3*1011"),$D(^XTMP("DG531011P")) D BMES^XPDUTL(" Not needed since patch has been installed previously.") Q
;
N %,DGDTS,DGDTE,DGCNT,DGIEN,DGFDA,DGERR,Y
;
;setup zero node of ^XTMP global (120 day expiration)
K ^XTMP("DG531011P")
S ^XTMP("DG531011P",0)=$$FMADD^XLFDT(DT,120)_U_DT_U_"EMERGENCY PATCH DG*5.3*1011"
;
;start time
D NOW^%DTC S Y=% D DD^%DT
S DGDTS=Y
;
;loop through "AERI" xref to retrieve patients with HURRICANE KATRINA indicator
S (DGIEN,DGCNT)=0
F S DGIEN=$O(^DPT("AERI","K",DGIEN)) Q:'DGIEN D
. S DGCNT=DGCNT+1
. ;place DFN in ^XTMP global
. S ^XTMP("DG531011P",$J,"DFN",DGCNT)=DGIEN
. ;
. ;now delete HURRICANE KATRINA indicator from record in PATIENT (#2) file
. S DGFDA(2,DGIEN_",",.181)="@"
. D FILE^DIE("","DGFDA","DGERR")
;
;end time
D NOW^%DTC S Y=% D DD^%DT
S DGDTE=Y
;
;place statistics into ^XTMP global
S ^XTMP("DG531011P",$J,"START")=$G(DGDTS) ;start date/time
S ^XTMP("DG531011P",$J,"END")=$G(DGDTE) ;end date/time
S ^XTMP("DG531011P",$J,"TOTAL")=DGCNT ;total records
;
D BMES^XPDUTL(" Total records stored in ^XTMP(""DG531011P"") global: "_+$G(DGCNT))
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDG531011P 1830 printed Oct 16, 2024@18:36:18 Page 2
DG531011P ;OIT/KCL - PRE-INSTALL ROUTINE FOR DG*5.3*1011 ;3/27/2020
+1 ;;5.3;Registration;**1011**;Aug 13,1993;Build 4
+2 ;
+3 ;no direct entry
+4 QUIT
+5 ;
EP ;Entry Point
+1 ;
+2 DO STORE
+3 ;
+4 QUIT
+5 ;
STORE ;Store patients with HURRICANE KATRINA indicator in ^XTMP global, then delete from patient record
+1 ;
+2 DO BMES^XPDUTL(">>> Store patients (DFNs) with HURRICANE KATRINA indicator in")
+3 DO MES^XPDUTL(" ^XTMP(""DG531011P"") global and delete indicator from the")
+4 DO MES^XPDUTL(" EMERGENCY RESPONSE INDICATOR (#.181) field of those records")
+5 DO MES^XPDUTL(" in PATIENT (#2) file.")
+6 ;
+7 ;quit if patch already installed and ^XTMP exists
+8 IF $$PATCH^XPDUTL("DG*5.3*1011")
IF $DATA(^XTMP("DG531011P"))
DO BMES^XPDUTL(" Not needed since patch has been installed previously.")
QUIT
+9 ;
+10 NEW %,DGDTS,DGDTE,DGCNT,DGIEN,DGFDA,DGERR,Y
+11 ;
+12 ;setup zero node of ^XTMP global (120 day expiration)
+13 KILL ^XTMP("DG531011P")
+14 SET ^XTMP("DG531011P",0)=$$FMADD^XLFDT(DT,120)_U_DT_U_"EMERGENCY PATCH DG*5.3*1011"
+15 ;
+16 ;start time
+17 DO NOW^%DTC
SET Y=%
DO DD^%DT
+18 SET DGDTS=Y
+19 ;
+20 ;loop through "AERI" xref to retrieve patients with HURRICANE KATRINA indicator
+21 SET (DGIEN,DGCNT)=0
+22 FOR
SET DGIEN=$ORDER(^DPT("AERI","K",DGIEN))
if 'DGIEN
QUIT
Begin DoDot:1
+23 SET DGCNT=DGCNT+1
+24 ;place DFN in ^XTMP global
+25 SET ^XTMP("DG531011P",$JOB,"DFN",DGCNT)=DGIEN
+26 ;
+27 ;now delete HURRICANE KATRINA indicator from record in PATIENT (#2) file
+28 SET DGFDA(2,DGIEN_",",.181)="@"
+29 DO FILE^DIE("","DGFDA","DGERR")
End DoDot:1
+30 ;
+31 ;end time
+32 DO NOW^%DTC
SET Y=%
DO DD^%DT
+33 SET DGDTE=Y
+34 ;
+35 ;place statistics into ^XTMP global
+36 ;start date/time
SET ^XTMP("DG531011P",$JOB,"START")=$GET(DGDTS)
+37 ;end date/time
SET ^XTMP("DG531011P",$JOB,"END")=$GET(DGDTE)
+38 ;total records
SET ^XTMP("DG531011P",$JOB,"TOTAL")=DGCNT
+39 ;
+40 DO BMES^XPDUTL(" Total records stored in ^XTMP(""DG531011P"") global: "_+$GET(DGCNT))
+41 ;
+42 QUIT