DGYSPOST ;ALB/MLI - POST-INIT FOR PATCH DG*5.3*54 ; 10 APRIL 95
;;5.3;Registration;**54,1015**;Aug 13, 1993;Build 21
;
; This is the post-init routine for patch DG*5.3*54.
;
EN ; entry point
N I,X
W !! F I=1:1 S X=$P($T(TEXT+I),";;",2) Q:X="QUIT" W !,X
S ZTRTN="DQ^DGYSPOST",ZTIO="",ZTDESC="Patch DG*5.3*54 post-init"
D ^%ZTLOAD
I $D(ZTSK) W !,"Task queued: ",ZTSK
E W "...RUNNING IMMEDIATELY" D DQ W !,"Done!"
K ZTDESC,ZTIO,ZTRTN,ZTSK
Q
;
;
DQ ; called to begin processing
N DGSTART
S DGSTART=$$NOW^XLFDT()
D SSNXREF,ARMCLN,MAIL
Q
;
;
SSNXREF ; update SSN x-ref in ^DPT if not currently set
N DFN,X
I '$D(ZTQUEUED) W !,">> Resetting SSN cross-reference on PATIENT file (#2)..."
F DFN=0:0 S DFN=$O(^DPT(DFN)) Q:'DFN D
. I '(DFN#1000),'$D(ZTQUEUED) W "."
. S X=$P($G(^DPT(DFN,0)),"^",9)
. I X]"",'$D(^DPT("SSN",X,DFN)) S ^(DFN)=""
Q
;
;
ARMCLN ; loop through ^DGPM("ARM" and make sure entries are valid
N CT,DFN,I,J
I '$D(ZTQUEUED) W !,">> Checking ARM cross-reference on PATIENT MOVEMENT file (#405)..."
S (CT,I)=0
F S I=$O(^DGPM("ARM",I)) Q:I']"" F J=0:0 S J=$O(^DGPM("ARM",I,J)) Q:'J D
. S CT=CT+1
. S DFN=$P($G(^DGPM(J,0)),"^",3)
. I $G(^DPT(+DFN,.108))'=I K ^DGPM("ARM",I,J)
. I '$D(ZTQUEUED),'(CT#50) W "."
Q
;
;
MAIL ; generate an e-mail bulletin when done
N DIFROM
S DGCOUNT=0
D LINE("The post-init for patch DG*5.3*54 has run to completion."),LINE("")
D LINE(" Start Time: "_DGSTART)
D LINE(" End Time: "_$$NOW^XLFDT()),LINE("")
D LINE("Please remove routine DGYSPOST from all systems at this time.")
S XMSUB="Patch DG*5.3*54 post-init has completed",XMN=0
S XMTEXT="DGTEXT("
S XMDUZ=.5,XMY(DUZ)=""
D ^XMD
K DGCOUNT,DGTEXT,XMDUZ,XMN,XMSUB,XMTEXT,XMY
Q
;
;
LINE(TEXT) ; add text to mail message
S DGCOUNT=DGCOUNT+1,DGTEXT(DGCOUNT)=TEXT
Q
;
;
TEXT ; text to display
;;You will now be asked for a time to queue the cross-reference
;;clean-up. We recommend you respond NOW as this update can be done
;;with users on the system. It is being queued in order to make the
;;initialization finish faster. Once the clean-up has finished, you
;;will receive an e-mail message.
;;
;;Please note, if you exit (^) without answering the 'Requested Start
;;Time: NOW//' prompt, the cross-reference clean-up will occur
;;immediately.
;;
;;QUIT
DGYSPOST ;ALB/MLI - POST-INIT FOR PATCH DG*5.3*54 ; 10 APRIL 95
+1 ;;5.3;Registration;**54,1015**;Aug 13, 1993;Build 21
+2 ;
+3 ; This is the post-init routine for patch DG*5.3*54.
+4 ;
EN ; entry point
+1 NEW I,X
+2 WRITE !!
FOR I=1:1
SET X=$PIECE($TEXT(TEXT+I),";;",2)
IF X="QUIT"
QUIT
WRITE !,X
+3 SET ZTRTN="DQ^DGYSPOST"
SET ZTIO=""
SET ZTDESC="Patch DG*5.3*54 post-init"
+4 DO ^%ZTLOAD
+5 IF $DATA(ZTSK)
WRITE !,"Task queued: ",ZTSK
+6 IF '$TEST
WRITE "...RUNNING IMMEDIATELY"
DO DQ
WRITE !,"Done!"
+7 KILL ZTDESC,ZTIO,ZTRTN,ZTSK
+8 QUIT
+9 ;
+10 ;
DQ ; called to begin processing
+1 NEW DGSTART
+2 SET DGSTART=$$NOW^XLFDT()
+3 DO SSNXREF
DO ARMCLN
DO MAIL
+4 QUIT
+5 ;
+6 ;
SSNXREF ; update SSN x-ref in ^DPT if not currently set
+1 NEW DFN,X
+2 IF '$DATA(ZTQUEUED)
WRITE !,">> Resetting SSN cross-reference on PATIENT file (#2)..."
+3 FOR DFN=0:0
SET DFN=$ORDER(^DPT(DFN))
IF 'DFN
QUIT
Begin DoDot:1
+4 IF '(DFN#1000)
IF '$DATA(ZTQUEUED)
WRITE "."
+5 SET X=$PIECE($GET(^DPT(DFN,0)),"^",9)
+6 IF X]""
IF '$DATA(^DPT("SSN",X,DFN))
SET ^(DFN)=""
End DoDot:1
+7 QUIT
+8 ;
+9 ;
ARMCLN ; loop through ^DGPM("ARM" and make sure entries are valid
+1 NEW CT,DFN,I,J
+2 IF '$DATA(ZTQUEUED)
WRITE !,">> Checking ARM cross-reference on PATIENT MOVEMENT file (#405)..."
+3 SET (CT,I)=0
+4 FOR
SET I=$ORDER(^DGPM("ARM",I))
IF I']""
QUIT
FOR J=0:0
SET J=$ORDER(^DGPM("ARM",I,J))
IF 'J
QUIT
Begin DoDot:1
+5 SET CT=CT+1
+6 SET DFN=$PIECE($GET(^DGPM(J,0)),"^",3)
+7 IF $GET(^DPT(+DFN,.108))'=I
KILL ^DGPM("ARM",I,J)
+8 IF '$DATA(ZTQUEUED)
IF '(CT#50)
WRITE "."
End DoDot:1
+9 QUIT
+10 ;
+11 ;
MAIL ; generate an e-mail bulletin when done
+1 NEW DIFROM
+2 SET DGCOUNT=0
+3 DO LINE("The post-init for patch DG*5.3*54 has run to completion.")
DO LINE("")
+4 DO LINE(" Start Time: "_DGSTART)
+5 DO LINE(" End Time: "_$$NOW^XLFDT())
DO LINE("")
+6 DO LINE("Please remove routine DGYSPOST from all systems at this time.")
+7 SET XMSUB="Patch DG*5.3*54 post-init has completed"
SET XMN=0
+8 SET XMTEXT="DGTEXT("
+9 SET XMDUZ=.5
SET XMY(DUZ)=""
+10 DO ^XMD
+11 KILL DGCOUNT,DGTEXT,XMDUZ,XMN,XMSUB,XMTEXT,XMY
+12 QUIT
+13 ;
+14 ;
LINE(TEXT) ; add text to mail message
+1 SET DGCOUNT=DGCOUNT+1
SET DGTEXT(DGCOUNT)=TEXT
+2 QUIT
+3 ;
+4 ;
TEXT ; text to display
+1 ;;You will now be asked for a time to queue the cross-reference
+2 ;;clean-up. We recommend you respond NOW as this update can be done
+3 ;;with users on the system. It is being queued in order to make the
+4 ;;initialization finish faster. Once the clean-up has finished, you
+5 ;;will receive an e-mail message.
+6 ;;
+7 ;;Please note, if you exit (^) without answering the 'Requested Start
+8 ;;Time: NOW//' prompt, the cross-reference clean-up will occur
+9 ;;immediately.
+10 ;;
+11 ;;QUIT