DG53658 ;ALB/PHH - DG*5.3*658 ADDRESS CHANGE DT/TM Cleanup ; 9/19/2005
;;5.3;Registration;**658,1015**;Aug 13, 1993;Build 21
Q
PREINST ; Pre-Install process to delete the old X-Ref trigger in
; PATIENT file #2 for ADDRESS CHANGE SOURCE field #.119
N DGFILE,DGFIELD,DGTRGNUM,DGUPDOUT
S DGFILE=2,DGFIELD=.119,DGTRGNUM=1
D DELIX^DDMOD(DGFILE,DGFIELD,DGTRGNUM,"K","DGUPDOUT")
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 "DG658"
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,ZTIO
S NAMESPC=$$NAMESPC
S QUEERR=0
S ZTRTN="CLEAN^DG53"_$P(NAMESPC,"DG",2)
S ZTDESC=NAMESPC_" - Address 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,ZTSTOP,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_" - ADDRESS 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,ADDRDTTM,RXFILLDT,DIE,DA,DR
S NAMESPC=$$NAMESPC
S ADDRDTTM=$P($G(^DPT(DFN,.11)),"^",13)
S RXFILLDT=$O(^PSRX("ACP",DFN,""),-1)
;
; If the ADDRESS CHANGE DT/TM field #.118 is null, set it to
; ISSUE DATE field #1 in the PRESCRIPTION file #52. Also update
; it, if it is older than the ISSUE DATE.
I ADDRDTTM=""!(ADDRDTTM<RXFILLDT) D
.S ^XTMP(NAMESPC,"DATA",DFN)=ADDRDTTM
.S ^XTMP(NAMESPC,"CONFIG","ANOMALY")=$G(^XTMP(NAMESPC,"CONFIG","ANOMALY"))+1
.S ^XTMP(NAMESPC,"CONFIG","DFN")=DFN
.S ADDRDTTM=RXFILLDT
.;
.; Set default date = 12-31-2003 if no entry is found in file #52.
.I ADDRDTTM="" D
..S ADDRDTTM=3031231
..S ^XTMP(NAMESPC,"CONFIG","NO-52")=$G(^XTMP(NAMESPC,"CONFIG","NO-52"))+1
.;
.S DIE="^DPT(",DA=DFN,DR=".118///^S X=ADDRDTTM"
.D:MODE ^DIE
.S $P(^XTMP(NAMESPC,"DATA",DFN),"^",2)=ADDRDTTM
.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
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_": ADDRESS 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_": ADDRESS 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
DG53658 ;ALB/PHH - DG*5.3*658 ADDRESS CHANGE DT/TM Cleanup ; 9/19/2005
+1 ;;5.3;Registration;**658,1015**;Aug 13, 1993;Build 21
+2 QUIT
PREINST ; Pre-Install process to delete the old X-Ref trigger in
+1 ; PATIENT file #2 for ADDRESS CHANGE SOURCE field #.119
+2 NEW DGFILE,DGFIELD,DGTRGNUM,DGUPDOUT
+3 SET DGFILE=2
SET DGFIELD=.119
SET DGTRGNUM=1
+4 DO DELIX^DDMOD(DGFILE,DGFIELD,DGTRGNUM,"K","DGUPDOUT")
+5 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 "DG658"
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,ZTIO
+2 SET NAMESPC=$$NAMESPC
+3 SET QUEERR=0
+4 SET ZTRTN="CLEAN^DG53"_$PIECE(NAMESPC,"DG",2)
+5 SET ZTDESC=NAMESPC_" - Address 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,ZTSTOP,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_" - ADDRESS 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,ADDRDTTM,RXFILLDT,DIE,DA,DR
+2 SET NAMESPC=$$NAMESPC
+3 SET ADDRDTTM=$PIECE($GET(^DPT(DFN,.11)),"^",13)
+4 SET RXFILLDT=$ORDER(^PSRX("ACP",DFN,""),-1)
+5 ;
+6 ; If the ADDRESS CHANGE DT/TM field #.118 is null, set it to
+7 ; ISSUE DATE field #1 in the PRESCRIPTION file #52. Also update
+8 ; it, if it is older than the ISSUE DATE.
+9 IF ADDRDTTM=""!(ADDRDTTM<RXFILLDT)
Begin DoDot:1
+10 SET ^XTMP(NAMESPC,"DATA",DFN)=ADDRDTTM
+11 SET ^XTMP(NAMESPC,"CONFIG","ANOMALY")=$GET(^XTMP(NAMESPC,"CONFIG","ANOMALY"))+1
+12 SET ^XTMP(NAMESPC,"CONFIG","DFN")=DFN
+13 SET ADDRDTTM=RXFILLDT
+14 ;
+15 ; Set default date = 12-31-2003 if no entry is found in file #52.
+16 IF ADDRDTTM=""
Begin DoDot:2
+17 SET ADDRDTTM=3031231
+18 SET ^XTMP(NAMESPC,"CONFIG","NO-52")=$GET(^XTMP(NAMESPC,"CONFIG","NO-52"))+1
End DoDot:2
+19 ;
+20 SET DIE="^DPT("
SET DA=DFN
SET DR=".118///^S X=ADDRDTTM"
+21 IF MODE
DO ^DIE
+22 SET $PIECE(^XTMP(NAMESPC,"DATA",DFN),"^",2)=ADDRDTTM
+23 SET ^XTMP(NAMESPC,"CONFIG","SUCCESS")=$GET(^XTMP(NAMESPC,"CONFIG","SUCCESS"))+1
End DoDot:1
+24 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
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_": ADDRESS 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_": ADDRESS 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