DGPMBSAB ;ALB/LM/ - AUTO RECALC ; 3/16/93
;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
;
Q
AUTO ; -- auto recalc entry point
D DAT^DGPMBSAR I E G Q^DGPMBSAR
;
S RC=RD
S EGL=$S($P(DGPM("G"),U,7):$P(DGPM("G"),U,7),1:DT)
;
D CLEAN^DGPMBSAR
;
S CD=$O(^DGS(43.5,"AGL",0)) I CD'<EGL,CD'>RC S RC=CD
;
D WDCHK^DGPMBSAR
;
S DIE="^DG(43,",DA=1,DR="57///N"_$S($D(^%ZOSF("VOL")):";58////"_^("VOL"),1:"")_";60///"_RC D ^DIE
;
AUTOQ K DR,DA,DIE,EGL,E,CD
;
RECALC D GO^DGPMBSAR ; Recalc entry point
;
S DIE="^DG(43,",DA=1,DR="59///N" D ^DIE ; Auto Recalc Finished
;
K DR,DA,DIE
;
SET ; Set variables for Auto Recalc Start/Finish Bulletin
S START=$S($P(^DG(43,1,"GLS"),"^",7)]"":$P(^DG(43,1,"GLS"),"^",7),1:"")
I START]"" S Y=START X ^DD("DD") S START=Y
;
S BACKTO=$S($P(^DG(43,1,"GLS"),"^",10)]"":$P(^DG(43,1,"GLS"),"^",10),1:"")
I BACKTO]"" S Y=BACKTO X ^DD("DD") S BACKTO=Y
;
S FINISH=$S($P(^DG(43,1,"GLS"),"^",9)]"":$P(^DG(43,1,"GLS"),"^",9),1:"")
I FINISH]"" S Y=FINISH X ^DD("DD") S FINISH=Y
;
TMP S ^TMP($J,"AUTORECALC",1,0)=" Date/Time Auto Recalc Started: "_START
S ^TMP($J,"AUTORECALC",2,0)=" Date Auto Recalc went back to: "_BACKTO
S ^TMP($J,"AUTORECALC",3,0)=" Date/Time Auto Recalc Finished: "_FINISH
;
BUL ; Bulletin when auto recalc start/finish
S DGB=12 ; position on the NOT (notification) Node - file #43
S XMSUB="AUTO RECALC START/FINISH"
S XMTEXT="^TMP($J,""AUTORECALC"","
;
D ^DGBUL
;
END K START,BACKTO,FINISH,Y,^TMP($J,"AUTORECALC")
Q
DGPMBSAB ;ALB/LM/ - AUTO RECALC ; 3/16/93
+1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
+2 ;
+3 QUIT
AUTO ; -- auto recalc entry point
+1 DO DAT^DGPMBSAR
IF E
GOTO Q^DGPMBSAR
+2 ;
+3 SET RC=RD
+4 SET EGL=$SELECT($PIECE(DGPM("G"),U,7):$PIECE(DGPM("G"),U,7),1:DT)
+5 ;
+6 DO CLEAN^DGPMBSAR
+7 ;
+8 SET CD=$ORDER(^DGS(43.5,"AGL",0))
IF CD'<EGL
IF CD'>RC
SET RC=CD
+9 ;
+10 DO WDCHK^DGPMBSAR
+11 ;
+12 SET DIE="^DG(43,"
SET DA=1
SET DR="57///N"_$SELECT($DATA(^%ZOSF("VOL")):";58////"_^("VOL"),1:"")_";60///"_RC
DO ^DIE
+13 ;
AUTOQ KILL DR,DA,DIE,EGL,E,CD
+1 ;
RECALC ; Recalc entry point
DO GO^DGPMBSAR
+1 ;
+2 ; Auto Recalc Finished
SET DIE="^DG(43,"
SET DA=1
SET DR="59///N"
DO ^DIE
+3 ;
+4 KILL DR,DA,DIE
+5 ;
SET ; Set variables for Auto Recalc Start/Finish Bulletin
+1 SET START=$SELECT($PIECE(^DG(43,1,"GLS"),"^",7)]"":$PIECE(^DG(43,1,"GLS"),"^",7),1:"")
+2 IF START]""
SET Y=START
XECUTE ^DD("DD")
SET START=Y
+3 ;
+4 SET BACKTO=$SELECT($PIECE(^DG(43,1,"GLS"),"^",10)]"":$PIECE(^DG(43,1,"GLS"),"^",10),1:"")
+5 IF BACKTO]""
SET Y=BACKTO
XECUTE ^DD("DD")
SET BACKTO=Y
+6 ;
+7 SET FINISH=$SELECT($PIECE(^DG(43,1,"GLS"),"^",9)]"":$PIECE(^DG(43,1,"GLS"),"^",9),1:"")
+8 IF FINISH]""
SET Y=FINISH
XECUTE ^DD("DD")
SET FINISH=Y
+9 ;
TMP SET ^TMP($JOB,"AUTORECALC",1,0)=" Date/Time Auto Recalc Started: "_START
+1 SET ^TMP($JOB,"AUTORECALC",2,0)=" Date Auto Recalc went back to: "_BACKTO
+2 SET ^TMP($JOB,"AUTORECALC",3,0)=" Date/Time Auto Recalc Finished: "_FINISH
+3 ;
BUL ; Bulletin when auto recalc start/finish
+1 ; position on the NOT (notification) Node - file #43
SET DGB=12
+2 SET XMSUB="AUTO RECALC START/FINISH"
+3 SET XMTEXT="^TMP($J,""AUTORECALC"","
+4 ;
+5 DO ^DGBUL
+6 ;
END KILL START,BACKTO,FINISH,Y,^TMP($JOB,"AUTORECALC")
+1 QUIT