DG53514 ;ALB/PHH - DG*5.3*514 DOD Cleanup ; 4/25/03
;;5.3;Registration;**514**;Aug 13, 1993
Q
RESET ; Reset the data for the cleanup process
K ^XTMP($$NAMESPC)
Q
TEST ; Simulate Live Run
N MODE
S MODE=0
START ; Start Processor
N NAMESPC,QTIME
S NAMESPC=$$NAMESPC
Q:$$RUNCHK(NAMESPC) ; Quit if already running or has run to completion
Q:$$QTIME(.QTIME)
S:$D(^XTMP(NAMESPC,"CONFIG","RUN MODE")) MODE=^XTMP(NAMESPC,"CONFIG","RUN MODE")
S:'$D(^XTMP(NAMESPC,"CONFIG","RUN MODE")) ^XTMP(NAMESPC,"CONFIG","RUN MODE")=$S($G(MODE)=0:0,1:1)
S ^XTMP(NAMESPC,"CONFIG","USER")=$S($G(DUZ)'="":DUZ,1:"UNKNOWN")
S:'$$QUEUE(QTIME) ^XTMP(NAMESPC,"CONFIG","RUNNING")=""
Q
NAMESPC() ; API returns the name space for this patch
Q "DG514"
RUNCHK(NAMESPC) ; Check to see if clean up is already running
Q:NAMESPC="" 1 ; Name Space must be defined
Q:$D(^XTMP(NAMESPC,"CONFIG","RUNNING")) 1
Q:$D(^XTMP(NAMESPC,"CONFIG","COMPLETE")) 1
Q 0
QTIME(WHEN) ; Get the run time for queuing
N %,%H,%I,X
D NOW^%DTC
S WHEN=$P(%,".")_"."_$E($P(%,".",2),1,4)
Q 0
QUEUE(ZTDTH) ; Queue the process
N NAMESPC,QUEERR,ZTDESC,ZTRTN,ZTSK
S NAMESPC=$$NAMESPC
S QUEERR=0
S ZTRTN="CLEAN^DG53"_$P(NAMESPC,"DG",2)
S ZTDESC=NAMESPC_" - DOD Cleanup Process"
S ZTIO=""
D ^%ZTLOAD
K ^XTMP(NAMESPC,"CONFIG","ZTSK")
I '$D(ZTSK) S ^XTMP(NAMESPC,"CONFIG","ZTSK")="Unable to queue post-install process.",QUEERR=1
I $D(ZTSK) S ^XTMP(NAMESPC,"CONFIG","ZTSK")="Post-install queued. Task ID: "_$G(ZTSK)
D HOME^%ZIS
Q QUEERR
CLEAN ; Actual cleanup process
N NAMESPC,MODE,USER,TASKID,%,%H,%I,X,X1,X2,CHKCNT,TMSWT,TOTDPT,DFN
S NAMESPC=$$NAMESPC
K ^XTMP(NAMESPC,"CONFIG","ABORT TIME")
S MODE=$G(^XTMP(NAMESPC,"CONFIG","RUN MODE"),0)
S USER=$G(^XTMP(NAMESPC,"CONFIG","USER"),"UNKNOWN")
S TASKID=$G(^XTMP(NAMESPC,"CONFIG","ZTSK"),"UNKNOWN")
;
I '$D(^XTMP(NAMESPC,0)) D
.K ^XTMP(NAMESPC)
.S ^XTMP(NAMESPC,"CONFIG","DFN")=0
.S ^XTMP(NAMESPC,"CONFIG","TOTPR")=0
.S ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=0
.S ^XTMP(NAMESPC,"CONFIG","RUN MODE")=MODE
.S ^XTMP(NAMESPC,"CONFIG","USER")=USER
.S ^XTMP(NAMESPC,"CONFIG","ZTSK")=TASKID
.D NOW^%DTC
.S ^XTMP(NAMESPC,"CONFIG","START TIME")=%
.S X1=$$DT^XLFDT,X2=90
.D C^%DTC
.S ^XTMP(NAMESPC,0)=X_U_$$DT^XLFDT_U_NAMESPC_" - DOD CLEANUP"
;
S CHKCNT=250,(ZTSTOP,TMSWT)=0,TOTDPT=+$P($G(^DPT(0)),"^",4)
S DFN=$G(^XTMP(NAMESPC,"CONFIG","DFN"))
F S DFN=$O(^DPT(DFN)) Q:'DFN!(TMSWT) D
.D PROC(DFN)
.S ^XTMP(NAMESPC,"CONFIG","TOTPR")=$G(^XTMP(NAMESPC,"CONFIG","TOTPR"))+1
.S ^XTMP(NAMESPC,"CONFIG","DFN")=DFN
.I TOTDPT D
..S ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=+$G(^XTMP(NAMESPC,"CONFIG","TOTPR"))/TOTDPT
..S ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=+$P((^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")*100),".")
.I +$G(^XTMP(NAMESPC,"CONFIG","TOTPR"))#CHKCNT=0 D
..S TMSWT=$$STOPIT()
..I TMSWT D
...S ZTSTOP=1
...N %,%H,%I,X
...D NOW^%DTC
...S ^XTMP(NAMESPC,"CONFIG","ABORT TIME")=%
...D ABORTMSG
;
I 'DFN,'TMSWT D
.N %,%H,%I,X
.D NOW^%DTC
.S ^XTMP(NAMESPC,"CONFIG","COMPLETE")=%
.S ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=100
.D DONEMSG
;
K ^XTMP(NAMESPC,"CONFIG","RUNNING")
Q
PROC(DFN) ; Process the DFN
N NAMESPC,DOD,CURENR,ENRSTAT,QLOGIEN,SUCCESS
S NAMESPC=$$NAMESPC
S DOD=$P($G(^DPT(DFN,.35)),"^")
Q:DOD=""
S CURENR=$P($G(^DPT(DFN,"ENR")),"^") ; Get Current Enr Record
Q:CURENR=""
S ENRSTAT=$P($G(^DGEN(27.11,CURENR,0)),"^",4)
Q:ENRSTAT'=1 ; Quit if it's not an 'Unverified' status
;
S ^XTMP(NAMESPC,"DATA",DFN)=""
S ^XTMP(NAMESPC,"CONFIG","ANOMALY")=$G(^XTMP(NAMESPC,"CONFIG","ANOMALY"))+1
S ^XTMP(NAMESPC,"CONFIG","DFN")=DFN
;
S SUCCESS=0
I MODE S SUCCESS=$$SEND(DFN) ; Resend the Z11 query
S $P(^XTMP(NAMESPC,"DATA",DFN),"^")=SUCCESS
;
I SUCCESS=0 S ^XTMP(NAMESPC,"CONFIG","FAILED")=$G(^XTMP(NAMESPC,"CONFIG","FAILED"))+1
I SUCCESS=1 S ^XTMP(NAMESPC,"CONFIG","SUCCESS")=$G(^XTMP(NAMESPC,"CONFIG","SUCCESS"))+1
Q
STOPIT() ; Checks if user requested task to stop
N X,STOPIT
S STOPIT=0
S X=$$S^%ZTLOAD
I X D ;
.S STOPIT=1
.I $G(ZTSK) S ZTSTOP=1
Q STOPIT
SEND(DFN) ; Send an ENROLLMENT/ELIGIBILITY QUERY to HEC for a veteran
;Output: returns 1 on success, 0 on failure.
;
I '$$ON^DGENQRY Q 0
N LAST,DGQRY,MSGID,SUCCESS,SENT,ERROR
S SUCCESS=1,ERROR=""
I '$$LOCK^DGENQRY($G(DFN)) S SUCCESS=0
S LAST=$$FINDLAST^DGENQRY(DFN) ; Find latest Enr. Query Log IEN
I LAST,$$GET^DGENQRY(LAST,.DGQRY) ;
D:SUCCESS
.S SENT=$$MSG^DGENQRY1(DFN,.MSGID,.ERROR)
.I 'SENT S SUCCESS=0 Q
.S DGQRY("DFN")=DFN
.S DGQRY("SENT")=SENT
.S DGQRY("STATUS")=0
.S DGQRY("MSGID")=MSGID
.S DGQRY("NOTIFY")=$G(NOTIFY)
.S DGQRY("FIRST")=$S($G(FIRST):FIRST,1:SENT)
.S DGQRY("RESPONSE")=""
.S DGQRY("RESPONSEID")=""
.I '$$LOG^DGENQRY(.DGQRY) S SUCCESS=0 Q
D UNLOCK^DGENQRY($G(DFN))
Q SUCCESS
ABORTMSG ; Send the user aborted message:
N NAMESPC,NAMESPCN,TMP,XMY,XMDUZ,XMTEXT,XMSUB
S NAMESPC=$$NAMESPC
S NAMESPCN=$P(NAMESPC,"DG",2)
S XMY(DUZ)="",XMDUZ="DG PACKAGE",XMTEXT="TMP("_NAMESPCN_","
S XMSUB="DG*5.3*"_NAMESPCN_": DOD CLEANUP - PROCESS STOPPED BY USER"
S TMP(NAMESPCN,1)="CLEANUP PROCESSING"
S TMP(NAMESPCN,2)="------------------"
S TMP(NAMESPCN,3)=""
S TMP(NAMESPCN,4)="The cleanup process was aborted prematurely. Here is the current status:"
S TMP(NAMESPCN,5)=""
S TMP(NAMESPCN,6)=" Start Date/Time: "_$$FMTE^XLFDT(+$G(^XTMP(NAMESPC,"CONFIG","START TIME")),"P")
S TMP(NAMESPCN,7)=" End Date/Time: "_$$FMTE^XLFDT(+$G(^XTMP(NAMESPC,"CONFIG","ABORT TIME")),"P")
S TMP(NAMESPCN,8)=""
S TMP(NAMESPCN,9)="Current Counts: "
S TMP(NAMESPCN,10)=" Total Patient Records Processed: "_+$G(^XTMP(NAMESPC,"CONFIG","TOTPR"))
S TMP(NAMESPCN,11)=" Total Anomalies Corrected: "_+$G(^XTMP(NAMESPC,"CONFIG","SUCCESS"))
S TMP(NAMESPCN,12)=" Percentage Completed: "_+$G(^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE"))_"%"
S TMP(NAMESPCN,13)=""
S TMP(NAMESPCN,14)=""
D ^XMD
Q
DONEMSG ; Send the user aborted message:
N NAMESPC,NAMESPCN,TMP,XMY,XMDUZ,XMTEXT,XMSUB
S NAMESPC=$$NAMESPC
S NAMESPCN=$P(NAMESPC,"DG",2)
S XMY(DUZ)="",XMDUZ="DG PACKAGE",XMTEXT="TMP("_NAMESPCN_","
S XMSUB="DG*5.3*"_NAMESPCN_": DOD CLEANUP - SUMMARY REPORT"
S TMP(NAMESPCN,1)="CLEANUP PROCESSING"
S TMP(NAMESPCN,2)="------------------"
S TMP(NAMESPCN,3)=""
S TMP(NAMESPCN,4)="The cleanup has run to completion. Here are the results:"
S TMP(NAMESPCN,5)=""
S TMP(NAMESPCN,6)=" Start Date/Time: "_$$FMTE^XLFDT(+$G(^XTMP(NAMESPC,"CONFIG","START TIME")),"P")
S TMP(NAMESPCN,7)=" End Date/Time: "_$$FMTE^XLFDT(+$G(^XTMP(NAMESPC,"CONFIG","COMPLETE")),"P")
S TMP(NAMESPCN,8)=""
S TMP(NAMESPCN,9)="Current Counts: "
S TMP(NAMESPCN,10)=" Total Patient Records Processed: "_+$G(^XTMP(NAMESPC,"CONFIG","TOTPR"))
S TMP(NAMESPCN,11)=" Total Anomalies Corrected: "_+$G(^XTMP(NAMESPC,"CONFIG","SUCCESS"))
S TMP(NAMESPCN,12)=" Percentage Completed: 100%"
S TMP(NAMESPCN,13)=""
S TMP(NAMESPCN,14)=""
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDG53514 7160 printed Dec 13, 2024@02:37:41 Page 2
DG53514 ;ALB/PHH - DG*5.3*514 DOD Cleanup ; 4/25/03
+1 ;;5.3;Registration;**514**;Aug 13, 1993
+2 QUIT
RESET ; Reset the data for the cleanup process
+1 KILL ^XTMP($$NAMESPC)
+2 QUIT
TEST ; Simulate Live Run
+1 NEW MODE
+2 SET MODE=0
START ; Start Processor
+1 NEW NAMESPC,QTIME
+2 SET NAMESPC=$$NAMESPC
+3 ; Quit if already running or has run to completion
if $$RUNCHK(NAMESPC)
QUIT
+4 if $$QTIME(.QTIME)
QUIT
+5 if $DATA(^XTMP(NAMESPC,"CONFIG","RUN MODE"))
SET MODE=^XTMP(NAMESPC,"CONFIG","RUN MODE")
+6 if '$DATA(^XTMP(NAMESPC,"CONFIG","RUN MODE"))
SET ^XTMP(NAMESPC,"CONFIG","RUN MODE")=$SELECT($GET(MODE)=0:0,1:1)
+7 SET ^XTMP(NAMESPC,"CONFIG","USER")=$SELECT($GET(DUZ)'="":DUZ,1:"UNKNOWN")
+8 if '$$QUEUE(QTIME)
SET ^XTMP(NAMESPC,"CONFIG","RUNNING")=""
+9 QUIT
NAMESPC() ; API returns the name space for this patch
+1 QUIT "DG514"
RUNCHK(NAMESPC) ; Check to see if clean up is already running
+1 ; Name Space must be defined
if NAMESPC=""
QUIT 1
+2 if $DATA(^XTMP(NAMESPC,"CONFIG","RUNNING"))
QUIT 1
+3 if $DATA(^XTMP(NAMESPC,"CONFIG","COMPLETE"))
QUIT 1
+4 QUIT 0
QTIME(WHEN) ; Get the run time for queuing
+1 NEW %,%H,%I,X
+2 DO NOW^%DTC
+3 SET WHEN=$PIECE(%,".")_"."_$EXTRACT($PIECE(%,".",2),1,4)
+4 QUIT 0
QUEUE(ZTDTH) ; Queue the process
+1 NEW NAMESPC,QUEERR,ZTDESC,ZTRTN,ZTSK
+2 SET NAMESPC=$$NAMESPC
+3 SET QUEERR=0
+4 SET ZTRTN="CLEAN^DG53"_$PIECE(NAMESPC,"DG",2)
+5 SET ZTDESC=NAMESPC_" - DOD Cleanup Process"
+6 SET ZTIO=""
+7 DO ^%ZTLOAD
+8 KILL ^XTMP(NAMESPC,"CONFIG","ZTSK")
+9 IF '$DATA(ZTSK)
SET ^XTMP(NAMESPC,"CONFIG","ZTSK")="Unable to queue post-install process."
SET QUEERR=1
+10 IF $DATA(ZTSK)
SET ^XTMP(NAMESPC,"CONFIG","ZTSK")="Post-install queued. Task ID: "_$GET(ZTSK)
+11 DO HOME^%ZIS
+12 QUIT QUEERR
CLEAN ; Actual cleanup process
+1 NEW NAMESPC,MODE,USER,TASKID,%,%H,%I,X,X1,X2,CHKCNT,TMSWT,TOTDPT,DFN
+2 SET NAMESPC=$$NAMESPC
+3 KILL ^XTMP(NAMESPC,"CONFIG","ABORT TIME")
+4 SET MODE=$GET(^XTMP(NAMESPC,"CONFIG","RUN MODE"),0)
+5 SET USER=$GET(^XTMP(NAMESPC,"CONFIG","USER"),"UNKNOWN")
+6 SET TASKID=$GET(^XTMP(NAMESPC,"CONFIG","ZTSK"),"UNKNOWN")
+7 ;
+8 IF '$DATA(^XTMP(NAMESPC,0))
Begin DoDot:1
+9 KILL ^XTMP(NAMESPC)
+10 SET ^XTMP(NAMESPC,"CONFIG","DFN")=0
+11 SET ^XTMP(NAMESPC,"CONFIG","TOTPR")=0
+12 SET ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=0
+13 SET ^XTMP(NAMESPC,"CONFIG","RUN MODE")=MODE
+14 SET ^XTMP(NAMESPC,"CONFIG","USER")=USER
+15 SET ^XTMP(NAMESPC,"CONFIG","ZTSK")=TASKID
+16 DO NOW^%DTC
+17 SET ^XTMP(NAMESPC,"CONFIG","START TIME")=%
+18 SET X1=$$DT^XLFDT
SET X2=90
+19 DO C^%DTC
+20 SET ^XTMP(NAMESPC,0)=X_U_$$DT^XLFDT_U_NAMESPC_" - DOD CLEANUP"
End DoDot:1
+21 ;
+22 SET CHKCNT=250
SET (ZTSTOP,TMSWT)=0
SET TOTDPT=+$PIECE($GET(^DPT(0)),"^",4)
+23 SET DFN=$GET(^XTMP(NAMESPC,"CONFIG","DFN"))
+24 FOR
SET DFN=$ORDER(^DPT(DFN))
if 'DFN!(TMSWT)
QUIT
Begin DoDot:1
+25 DO PROC(DFN)
+26 SET ^XTMP(NAMESPC,"CONFIG","TOTPR")=$GET(^XTMP(NAMESPC,"CONFIG","TOTPR"))+1
+27 SET ^XTMP(NAMESPC,"CONFIG","DFN")=DFN
+28 IF TOTDPT
Begin DoDot:2
+29 SET ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=+$GET(^XTMP(NAMESPC,"CONFIG","TOTPR"))/TOTDPT
+30 SET ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=+$PIECE((^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")*100),".")
End DoDot:2
+31 IF +$GET(^XTMP(NAMESPC,"CONFIG","TOTPR"))#CHKCNT=0
Begin DoDot:2
+32 SET TMSWT=$$STOPIT()
+33 IF TMSWT
Begin DoDot:3
+34 SET ZTSTOP=1
+35 NEW %,%H,%I,X
+36 DO NOW^%DTC
+37 SET ^XTMP(NAMESPC,"CONFIG","ABORT TIME")=%
+38 DO ABORTMSG
End DoDot:3
End DoDot:2
End DoDot:1
+39 ;
+40 IF 'DFN
IF 'TMSWT
Begin DoDot:1
+41 NEW %,%H,%I,X
+42 DO NOW^%DTC
+43 SET ^XTMP(NAMESPC,"CONFIG","COMPLETE")=%
+44 SET ^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE")=100
+45 DO DONEMSG
End DoDot:1
+46 ;
+47 KILL ^XTMP(NAMESPC,"CONFIG","RUNNING")
+48 QUIT
PROC(DFN) ; Process the DFN
+1 NEW NAMESPC,DOD,CURENR,ENRSTAT,QLOGIEN,SUCCESS
+2 SET NAMESPC=$$NAMESPC
+3 SET DOD=$PIECE($GET(^DPT(DFN,.35)),"^")
+4 if DOD=""
QUIT
+5 ; Get Current Enr Record
SET CURENR=$PIECE($GET(^DPT(DFN,"ENR")),"^")
+6 if CURENR=""
QUIT
+7 SET ENRSTAT=$PIECE($GET(^DGEN(27.11,CURENR,0)),"^",4)
+8 ; Quit if it's not an 'Unverified' status
if ENRSTAT'=1
QUIT
+9 ;
+10 SET ^XTMP(NAMESPC,"DATA",DFN)=""
+11 SET ^XTMP(NAMESPC,"CONFIG","ANOMALY")=$GET(^XTMP(NAMESPC,"CONFIG","ANOMALY"))+1
+12 SET ^XTMP(NAMESPC,"CONFIG","DFN")=DFN
+13 ;
+14 SET SUCCESS=0
+15 ; Resend the Z11 query
IF MODE
SET SUCCESS=$$SEND(DFN)
+16 SET $PIECE(^XTMP(NAMESPC,"DATA",DFN),"^")=SUCCESS
+17 ;
+18 IF SUCCESS=0
SET ^XTMP(NAMESPC,"CONFIG","FAILED")=$GET(^XTMP(NAMESPC,"CONFIG","FAILED"))+1
+19 IF SUCCESS=1
SET ^XTMP(NAMESPC,"CONFIG","SUCCESS")=$GET(^XTMP(NAMESPC,"CONFIG","SUCCESS"))+1
+20 QUIT
STOPIT() ; Checks if user requested task to stop
+1 NEW X,STOPIT
+2 SET STOPIT=0
+3 SET X=$$S^%ZTLOAD
+4 ;
IF X
Begin DoDot:1
+5 SET STOPIT=1
+6 IF $GET(ZTSK)
SET ZTSTOP=1
End DoDot:1
+7 QUIT STOPIT
SEND(DFN) ; Send an ENROLLMENT/ELIGIBILITY QUERY to HEC for a veteran
+1 ;Output: returns 1 on success, 0 on failure.
+2 ;
+3 IF '$$ON^DGENQRY
QUIT 0
+4 NEW LAST,DGQRY,MSGID,SUCCESS,SENT,ERROR
+5 SET SUCCESS=1
SET ERROR=""
+6 IF '$$LOCK^DGENQRY($GET(DFN))
SET SUCCESS=0
+7 ; Find latest Enr. Query Log IEN
SET LAST=$$FINDLAST^DGENQRY(DFN)
+8 ;
IF LAST
IF $$GET^DGENQRY(LAST,.DGQRY)
+9 if SUCCESS
Begin DoDot:1
+10 SET SENT=$$MSG^DGENQRY1(DFN,.MSGID,.ERROR)
+11 IF 'SENT
SET SUCCESS=0
QUIT
+12 SET DGQRY("DFN")=DFN
+13 SET DGQRY("SENT")=SENT
+14 SET DGQRY("STATUS")=0
+15 SET DGQRY("MSGID")=MSGID
+16 SET DGQRY("NOTIFY")=$GET(NOTIFY)
+17 SET DGQRY("FIRST")=$SELECT($GET(FIRST):FIRST,1:SENT)
+18 SET DGQRY("RESPONSE")=""
+19 SET DGQRY("RESPONSEID")=""
+20 IF '$$LOG^DGENQRY(.DGQRY)
SET SUCCESS=0
QUIT
End DoDot:1
+21 DO UNLOCK^DGENQRY($GET(DFN))
+22 QUIT SUCCESS
ABORTMSG ; Send the user aborted message:
+1 NEW NAMESPC,NAMESPCN,TMP,XMY,XMDUZ,XMTEXT,XMSUB
+2 SET NAMESPC=$$NAMESPC
+3 SET NAMESPCN=$PIECE(NAMESPC,"DG",2)
+4 SET XMY(DUZ)=""
SET XMDUZ="DG PACKAGE"
SET XMTEXT="TMP("_NAMESPCN_","
+5 SET XMSUB="DG*5.3*"_NAMESPCN_": DOD CLEANUP - PROCESS STOPPED BY USER"
+6 SET TMP(NAMESPCN,1)="CLEANUP PROCESSING"
+7 SET TMP(NAMESPCN,2)="------------------"
+8 SET TMP(NAMESPCN,3)=""
+9 SET TMP(NAMESPCN,4)="The cleanup process was aborted prematurely. Here is the current status:"
+10 SET TMP(NAMESPCN,5)=""
+11 SET TMP(NAMESPCN,6)=" Start Date/Time: "_$$FMTE^XLFDT(+$GET(^XTMP(NAMESPC,"CONFIG","START TIME")),"P")
+12 SET TMP(NAMESPCN,7)=" End Date/Time: "_$$FMTE^XLFDT(+$GET(^XTMP(NAMESPC,"CONFIG","ABORT TIME")),"P")
+13 SET TMP(NAMESPCN,8)=""
+14 SET TMP(NAMESPCN,9)="Current Counts: "
+15 SET TMP(NAMESPCN,10)=" Total Patient Records Processed: "_+$GET(^XTMP(NAMESPC,"CONFIG","TOTPR"))
+16 SET TMP(NAMESPCN,11)=" Total Anomalies Corrected: "_+$GET(^XTMP(NAMESPC,"CONFIG","SUCCESS"))
+17 SET TMP(NAMESPCN,12)=" Percentage Completed: "_+$GET(^XTMP(NAMESPC,"CONFIG","PERCENT COMPLETE"))_"%"
+18 SET TMP(NAMESPCN,13)=""
+19 SET TMP(NAMESPCN,14)=""
+20 DO ^XMD
+21 QUIT
DONEMSG ; Send the user aborted message:
+1 NEW NAMESPC,NAMESPCN,TMP,XMY,XMDUZ,XMTEXT,XMSUB
+2 SET NAMESPC=$$NAMESPC
+3 SET NAMESPCN=$PIECE(NAMESPC,"DG",2)
+4 SET XMY(DUZ)=""
SET XMDUZ="DG PACKAGE"
SET XMTEXT="TMP("_NAMESPCN_","
+5 SET XMSUB="DG*5.3*"_NAMESPCN_": DOD CLEANUP - SUMMARY REPORT"
+6 SET TMP(NAMESPCN,1)="CLEANUP PROCESSING"
+7 SET TMP(NAMESPCN,2)="------------------"
+8 SET TMP(NAMESPCN,3)=""
+9 SET TMP(NAMESPCN,4)="The cleanup has run to completion. Here are the results:"
+10 SET TMP(NAMESPCN,5)=""
+11 SET TMP(NAMESPCN,6)=" Start Date/Time: "_$$FMTE^XLFDT(+$GET(^XTMP(NAMESPC,"CONFIG","START TIME")),"P")
+12 SET TMP(NAMESPCN,7)=" End Date/Time: "_$$FMTE^XLFDT(+$GET(^XTMP(NAMESPC,"CONFIG","COMPLETE")),"P")
+13 SET TMP(NAMESPCN,8)=""
+14 SET TMP(NAMESPCN,9)="Current Counts: "
+15 SET TMP(NAMESPCN,10)=" Total Patient Records Processed: "_+$GET(^XTMP(NAMESPC,"CONFIG","TOTPR"))
+16 SET TMP(NAMESPCN,11)=" Total Anomalies Corrected: "_+$GET(^XTMP(NAMESPC,"CONFIG","SUCCESS"))
+17 SET TMP(NAMESPCN,12)=" Percentage Completed: 100%"
+18 SET TMP(NAMESPCN,13)=""
+19 SET TMP(NAMESPCN,14)=""
+20 DO ^XMD
+21 QUIT