DGSTAT ;ALB/MRL - ADT SYSTEM STATUS DISPLAY ; 03/12/2004
;;5.3;Registration;**75,151,568,1015**;Aug 13, 1993;Build 21
;
; modified for K8, 12/7/95; mli
;
EN ; main entry point
I $$VERSION^XPDUTL("XU")<8 W !,"You must have KERNEL version 8.0 or higher to run this option!" G Q
S ^UTILITY("DG",$J,"ST")=""
S DGUSER=$P($G(^VA(200,+DUZ,.1)),"^",4),DGNOW=$$NOW^XLFDT()
W @IOF,!,$$GREETING(),$S(DGUSER]"":" "_DGUSER,1:""),". Welcome to MAS, VERSION ",$$VERSION^XPDUTL("REGISTRATION"),!
F I=1:1:40 W "= "
F I=334,345 S X=$O(^DGAM(I,"ALST",0)) I X W !,"AMIS ",I S DGX=$X D L W "Last run for month of ",$$DATE(X,1) ; amis 334,345
S X=$P($P($G(^DG(43,1,"AMIS")),"^",6),"'",2)
W !,"AMIS 401-420 Reports" S DGX=$X D L W "Last run for month of ",$$DATE(X,1) ; amis 400s
S X=$G(^DG(43,1,"GLS"))
W !,"Auto Recalculation" S DGX=$X D L W "Last run ",$$DATE(X,7)," on CPU ",$P(X,"^",8) ; auto recalc
S X=$$SCHED("DG G&L RECALCULATION AUTO")
W ! D L W "Scheduled for ",$S(X:$$DATE(X,1),1:"(not currently scheduled)")
I X<DGNOW D
. N DIQUIET ; uced to silence echo of date in %dt
. S DIQUIET=1
. W ! D L W "Rescheduled to run at 9 p.m."
. D RESCH^XUTMOPT("DG G&L RECALCULATION AUTO",DT_.2100,,,"L")
W !,"Embosser Option from Registration" S DGX=$X D L W "Is turned ",$$ONOFF(28) ; emboss on/off
W !,"Gains & Losses (G&L)" S DGX=$X D L W "Last run ",$$DATE($G(^DG(43,1,"GLS")),11) ; g&l
W !,"HINQ Option from Registration" S DGX=$X D L W "Is turned ",$$ONOFF(27) ; hinq at reg
W !,"RUG-II Background Job" S DGX=$X D L W "Last run ",$$DATE($G(^DG(43,1,"RUG")),1) ; rug bgj
S X=$$LAST^DGSDUTL,X=$G(^SDD(409.65,+X,0)) ; appt stat upd
W !,"Appointment Status Update" S DGX=$X D L W "Last run ",$$DATE(X,5)
W ! D L W "Updated appointments for ",$$DATE(X,1)
W ! D L W "Scheduled for " S X=$$SCHED("SDAM BACKGROUND JOB") W $S(X:$$UP^XLFSTR($$FMTE^XLFDT(X)),1:"(not currently scheduled)")
W !,"IRT Background Job" S DGX=$X D L W "Last run ",$$DATE($G(^DG(43,1,"IRT")),1) ; irt bgj
W ! D L W "Scheduled for " S X=$$SCHED("DGJ IRT UPDATE (Background)") W $S(X:$$UP^XLFSTR($$FMTE^XLFDT(X)),1:"(not currently scheduled)")
I $D(^%ZOSF("UCI")) X ^("UCI") W !!,"YOU ARE PRESENTLY ON CPU ",Y,!
Q W ! I $D(DUZ("AUTO")),DUZ("AUTO") R "Press RETURN to continue: ",X:DTIME
K %DT,%H,DA,DGRE,DGUSER,DGVERS,DGX,DIE,DR,I,DGNOW,X,Y Q
;
ONOFF(PIECE) ; return ON or OFF
; input - piece of 0 node of file 43 wanted
; output - ON or OFF
;
Q $S($P($G(^DG(43,1,0)),"^",PIECE):"ON",1:"OFF")
;
DATE(NODE,PIECE) ; return appropriate date
; input - NODE as node of data
; PIECE as piece of node to convert
; output - date in external format
;
Q $$UP^XLFSTR($$FMTE^XLFDT($P(NODE,"^",PIECE)))
;
SHOW I $S('$D(^DG(43,1,0)):1,'$P(^(0),"^",34):1,$D(^UTILITY("DG",$J,"ST")):1,1:0) Q
G EN
;
L ; write line of dots
;
W ?DGX+1 F I=1:1:(36-(DGX+1)) W "."
W " "
Q
;
GREETING() ; randomize greeting
N X,%H
S X=$P("Hello^Hi There^Good ^Hello There^Hi","^",$R(5)+1)
I X["Good" S %H=$P($H,",",2),X=X_$S(%H<43200:"Morning",%H<61200:"Afternoon",1:"Evening")
Q X
;
SCHED(OPTION) ; sent back time time for queued process
; input - OPTION as name of option
; output - date currently queued (external format)
N I,IEN,X
S (I,X)=0,IEN=$$LKOPT^XPDMENU(OPTION)
F S I=$O(^DIC(19.2,"B",IEN,I)) Q:'I S X=$P($G(^DIC(19.2,+I,0)),"^",2) Q:X>$$NOW^XLFDT()
Q X
DGSTAT ;ALB/MRL - ADT SYSTEM STATUS DISPLAY ; 03/12/2004
+1 ;;5.3;Registration;**75,151,568,1015**;Aug 13, 1993;Build 21
+2 ;
+3 ; modified for K8, 12/7/95; mli
+4 ;
EN ; main entry point
+1 IF $$VERSION^XPDUTL("XU")<8
WRITE !,"You must have KERNEL version 8.0 or higher to run this option!"
GOTO Q
+2 SET ^UTILITY("DG",$JOB,"ST")=""
+3 SET DGUSER=$PIECE($GET(^VA(200,+DUZ,.1)),"^",4)
SET DGNOW=$$NOW^XLFDT()
+4 WRITE @IOF,!,$$GREETING(),$SELECT(DGUSER]"":" "_DGUSER,1:""),". Welcome to MAS, VERSION ",$$VERSION^XPDUTL("REGISTRATION"),!
+5 FOR I=1:1:40
WRITE "= "
+6 ; amis 334,345
FOR I=334,345
SET X=$ORDER(^DGAM(I,"ALST",0))
IF X
WRITE !,"AMIS ",I
SET DGX=$X
DO L
WRITE "Last run for month of ",$$DATE(X,1)
+7 SET X=$PIECE($PIECE($GET(^DG(43,1,"AMIS")),"^",6),"'",2)
+8 ; amis 400s
WRITE !,"AMIS 401-420 Reports"
SET DGX=$X
DO L
WRITE "Last run for month of ",$$DATE(X,1)
+9 SET X=$GET(^DG(43,1,"GLS"))
+10 ; auto recalc
WRITE !,"Auto Recalculation"
SET DGX=$X
DO L
WRITE "Last run ",$$DATE(X,7)," on CPU ",$PIECE(X,"^",8)
+11 SET X=$$SCHED("DG G&L RECALCULATION AUTO")
+12 WRITE !
DO L
WRITE "Scheduled for ",$SELECT(X:$$DATE(X,1),1:"(not currently scheduled)")
+13 IF X<DGNOW
Begin DoDot:1
+14 ; uced to silence echo of date in %dt
NEW DIQUIET
+15 SET DIQUIET=1
+16 WRITE !
DO L
WRITE "Rescheduled to run at 9 p.m."
+17 DO RESCH^XUTMOPT("DG G&L RECALCULATION AUTO",DT_.2100,,,"L")
End DoDot:1
+18 ; emboss on/off
WRITE !,"Embosser Option from Registration"
SET DGX=$X
DO L
WRITE "Is turned ",$$ONOFF(28)
+19 ; g&l
WRITE !,"Gains & Losses (G&L)"
SET DGX=$X
DO L
WRITE "Last run ",$$DATE($GET(^DG(43,1,"GLS")),11)
+20 ; hinq at reg
WRITE !,"HINQ Option from Registration"
SET DGX=$X
DO L
WRITE "Is turned ",$$ONOFF(27)
+21 ; rug bgj
WRITE !,"RUG-II Background Job"
SET DGX=$X
DO L
WRITE "Last run ",$$DATE($GET(^DG(43,1,"RUG")),1)
+22 ; appt stat upd
SET X=$$LAST^DGSDUTL
SET X=$GET(^SDD(409.65,+X,0))
+23 WRITE !,"Appointment Status Update"
SET DGX=$X
DO L
WRITE "Last run ",$$DATE(X,5)
+24 WRITE !
DO L
WRITE "Updated appointments for ",$$DATE(X,1)
+25 WRITE !
DO L
WRITE "Scheduled for "
SET X=$$SCHED("SDAM BACKGROUND JOB")
WRITE $SELECT(X:$$UP^XLFSTR($$FMTE^XLFDT(X)),1:"(not currently scheduled)")
+26 ; irt bgj
WRITE !,"IRT Background Job"
SET DGX=$X
DO L
WRITE "Last run ",$$DATE($GET(^DG(43,1,"IRT")),1)
+27 WRITE !
DO L
WRITE "Scheduled for "
SET X=$$SCHED("DGJ IRT UPDATE (Background)")
WRITE $SELECT(X:$$UP^XLFSTR($$FMTE^XLFDT(X)),1:"(not currently scheduled)")
+28 IF $DATA(^%ZOSF("UCI"))
XECUTE ^("UCI")
WRITE !!,"YOU ARE PRESENTLY ON CPU ",Y,!
Q WRITE !
IF $DATA(DUZ("AUTO"))
IF DUZ("AUTO")
READ "Press RETURN to continue: ",X:DTIME
+1 KILL %DT,%H,DA,DGRE,DGUSER,DGVERS,DGX,DIE,DR,I,DGNOW,X,Y
QUIT
+2 ;
ONOFF(PIECE) ; return ON or OFF
+1 ; input - piece of 0 node of file 43 wanted
+2 ; output - ON or OFF
+3 ;
+4 QUIT $SELECT($PIECE($GET(^DG(43,1,0)),"^",PIECE):"ON",1:"OFF")
+5 ;
DATE(NODE,PIECE) ; return appropriate date
+1 ; input - NODE as node of data
+2 ; PIECE as piece of node to convert
+3 ; output - date in external format
+4 ;
+5 QUIT $$UP^XLFSTR($$FMTE^XLFDT($PIECE(NODE,"^",PIECE)))
+6 ;
SHOW IF $SELECT('$DATA(^DG(43,1,0)):1,'$PIECE(^(0),"^",34):1,$DATA(^UTILITY("DG",$JOB,"ST")):1,1:0)
QUIT
+1 GOTO EN
+2 ;
L ; write line of dots
+1 ;
+2 WRITE ?DGX+1
FOR I=1:1:(36-(DGX+1))
WRITE "."
+3 WRITE " "
+4 QUIT
+5 ;
GREETING() ; randomize greeting
+1 NEW X,%H
+2 SET X=$PIECE("Hello^Hi There^Good ^Hello There^Hi","^",$RANDOM(5)+1)
+3 IF X["Good"
SET %H=$PIECE($HOROLOG,",",2)
SET X=X_$SELECT(%H<43200:"Morning",%H<61200:"Afternoon",1:"Evening")
+4 QUIT X
+5 ;
SCHED(OPTION) ; sent back time time for queued process
+1 ; input - OPTION as name of option
+2 ; output - date currently queued (external format)
+3 NEW I,IEN,X
+4 SET (I,X)=0
SET IEN=$$LKOPT^XPDMENU(OPTION)
+5 FOR
SET I=$ORDER(^DIC(19.2,"B",IEN,I))
IF 'I
QUIT
SET X=$PIECE($GET(^DIC(19.2,+I,0)),"^",2)
IF X>$$NOW^XLFDT()
QUIT
+6 QUIT X