SDAMQ2 ;ALB/MJK - AM Background Utilities (cont.) ; 12/1/91
;;5.3;Scheduling;**132**;Aug 13, 1993
;
CHK(SDBEG,SDEND,SDPCE) ; -- check if all dates are processed
N SDDT,X1,X2,X K ^TMP("SDAM NOT UPDATED",$J)
S SDDT=$S(SDBEG<$$SWITCH^SDAMU:$$SWITCH^SDAMU,1:SDBEG)
F Q:SDDT>SDEND D
.S:'$P($G(^SDD(409.65,+$O(^SDD(409.65,"B",SDDT,0)),0)),U,SDPCE) ^TMP("SDAM NOT UPDATED",$J,SDDT)=""
.S X1=SDDT,X2=1 D C^%DTC S SDDT=X
Q
;
WKL(SDBEG,SDEND) ; -- check if all dates have been updated
W !!,"Will now check if outpatient encounter dates have been updated..."
D CHK(SDBEG,SDEND,5)
I '$D(^TMP("SDAM NOT UPDATED",$J))>0 W "everything looks ok.",! G WKLQ
W !!,*7,"The outpatient encounter status update process has not completed"
W !,"for the following dates:",!
D LIST
W !!,"Note: To obtain accurate statistics, this workload report should"
W !," be run again after the outpatient encounter status update"
W !," process has been completed for these dates.",!
WKLQ K ^TMP("SDAM NOT UPDATED",$J)
Q
;
LIST ; -- list error dates for display
N COUNT,SDDT
S COUNT=0,SDDT=0
F S SDDT=$O(^TMP("SDAM NOT UPDATED",$J,SDDT)) Q:'SDDT D
.S COUNT=COUNT+1 W ?$P("10^30^50",U,COUNT),$$FDATE^VALM1(SDDT)
.I COUNT=3 W ! S COUNT=0
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDAMQ2 1270 printed Dec 13, 2024@02:48:12 Page 2
SDAMQ2 ;ALB/MJK - AM Background Utilities (cont.) ; 12/1/91
+1 ;;5.3;Scheduling;**132**;Aug 13, 1993
+2 ;
CHK(SDBEG,SDEND,SDPCE) ; -- check if all dates are processed
+1 NEW SDDT,X1,X2,X
KILL ^TMP("SDAM NOT UPDATED",$JOB)
+2 SET SDDT=$SELECT(SDBEG<$$SWITCH^SDAMU:$$SWITCH^SDAMU,1:SDBEG)
+3 FOR
if SDDT>SDEND
QUIT
Begin DoDot:1
+4 if '$PIECE($GET(^SDD(409.65,+$ORDER(^SDD(409.65,"B",SDDT,0)),0)),U,SDPCE)
SET ^TMP("SDAM NOT UPDATED",$JOB,SDDT)=""
+5 SET X1=SDDT
SET X2=1
DO C^%DTC
SET SDDT=X
End DoDot:1
+6 QUIT
+7 ;
WKL(SDBEG,SDEND) ; -- check if all dates have been updated
+1 WRITE !!,"Will now check if outpatient encounter dates have been updated..."
+2 DO CHK(SDBEG,SDEND,5)
+3 IF '$DATA(^TMP("SDAM NOT UPDATED",$JOB))>0
WRITE "everything looks ok.",!
GOTO WKLQ
+4 WRITE !!,*7,"The outpatient encounter status update process has not completed"
+5 WRITE !,"for the following dates:",!
+6 DO LIST
+7 WRITE !!,"Note: To obtain accurate statistics, this workload report should"
+8 WRITE !," be run again after the outpatient encounter status update"
+9 WRITE !," process has been completed for these dates.",!
WKLQ KILL ^TMP("SDAM NOT UPDATED",$JOB)
+1 QUIT
+2 ;
LIST ; -- list error dates for display
+1 NEW COUNT,SDDT
+2 SET COUNT=0
SET SDDT=0
+3 FOR
SET SDDT=$ORDER(^TMP("SDAM NOT UPDATED",$JOB,SDDT))
if 'SDDT
QUIT
Begin DoDot:1
+4 SET COUNT=COUNT+1
WRITE ?$PIECE("10^30^50",U,COUNT),$$FDATE^VALM1(SDDT)
+5 IF COUNT=3
WRITE !
SET COUNT=0
End DoDot:1
+6 QUIT