HLEVREP2 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
;
CTRL ; Called by 'Display monitor details [HLEV MONITOR DETAILS]'
N MONM
;
KILL ^TMP($J)
;
D HD
D EX
W !
QUIT:$$BTE^HLCSMON("Press RETURN to collect data, or enter '^' to exit... ") ;->
D MONVALL
;
F D QUIT:MONM']""
. D MONLIST
. W !
. S MONM=$$ASKMON QUIT:MONM']"" ;->
. S WAY=$$ORDER I WAY'?1N S MONM="" QUIT ;->
. I WAY=1 D SHOWR(MONM)
. I WAY=2 D SHOWF(MONM)
. D HD
;
KILL ^TMP($J)
;
Q
;
SHOWF(MONM) ; Show monitors from oldest to newest
N ABRT,HLEVIENJ,PMT
W !
S ABRT=0,HLEVIENJ=0
F S HLEVIENJ=$O(^TMP($J,"HLMONL",MONM,HLEVIENJ)) Q:'HLEVIENJ!(ABRT) D
. S X=$$NEXT,ABRT=$P(X,U,2),PRINT=+X QUIT:ABRT ;->
. I PRINT D SHOW(HLEVIENJ) W !
Q
;
SHOWR(MONM) ; Show monitors from newest to oldest
N ABRT,HLEVIENJ,PRINT,X
W !
S ABRT=0,HLEVIENJ=":"
F S HLEVIENJ=$O(^TMP($J,"HLMONL",MONM,HLEVIENJ),-1) Q:'HLEVIENJ!(ABRT) D
. S X=$$NEXT,ABRT=$P(X,U,2),PRINT=+X QUIT:ABRT ;->
. I PRINT D SHOW(HLEVIENJ) W !
Q
;
NEXT() ; Show next entry?
N ANS
S ANS=$$YN^HLEVUTIL("Display monitor ""run"" started at "_$P(^TMP($J,"HLMON",+HLEVIENJ,"START"),U,3),"No")
I ANS=1 QUIT "1^0" ;-> Display^Abort
I ANS="" QUIT "0^0" ;->
Q "0^1"
;
SHOW(HLEVIENJ) ; Ask if want to view...
N GBL,LINES,MONM
;
S GBL=$NA(^TMP($J,"HLMON",HLEVIENJ))
;
;
S LINES=$O(@GBL@("VIEW",":"),-1)
S MONM=$P($G(@GBL@("MONM")),U,3) QUIT:MONM']"" ;->
S MONM=MONM_"[#"_HLEVIENJ_"]"
;
I LINES<22 D QUIT ;->
. W @IOF,$$CJ^XLFSTR(MONM,IOM),!,$$REPEAT^XLFSTR("=",IOM)
. S NO=0
. F S NO=$O(^TMP($J,"HLMON",+HLEVIENJ,"VIEW",NO)) Q:NO'>0 D
. . W !,^TMP($J,"HLMON",+HLEVIENJ,"VIEW",NO)
;
D BROWSE^DDBR($NA(^TMP($J,"HLMON",+HLEVIENJ,"VIEW")),"N",MONM)
;
Q
;
ORDER() ; $ORDER direction...
N DIR,DIRUT,DTOUT,DUOUT
S DIR(0)="S^1:Show entries from newest to oldest;2:Show entries from oldest to newest;3:Exit"
S DIR("A")="Select display direction"
S DIR("B")=1
D ^DIR
Q $S(+Y=1!(+Y=2):+Y,1:"")
;
ASKMON() ; Ask user to select a monitor...
N DIC,X,Y
S DIC=776.1,DIC(0)="AEMQ",DIC("A")="Select MONITOR: "
S DIC("S")="S HLEV=$P($G(^HLEV(776.1,+Y,0)),U) I HLEV]"""",$D(^TMP($J,""HLMONL"",HLEV))"
D ^DIC
Q $S(+Y>0:$P(Y,U,2),1:"")
;
HD W @IOF,$$CJ^XLFSTR("Display Monitor Details",IOM)
W !,$$REPEAT^XLFSTR("=",IOM)
QUIT
;
EX N I,T F I=1:1 S T=$T(EX+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
;;This option displays a detailed view of monitor run-time data. You can loop
;;through all occurrences of a monitor from oldest to most recent, or from most
;;recent to oldest.
QUIT
;
MONLIST ; Create and print list of monitors...
N DATA,HLEVIENJ
;
I '$D(^TMP($J,"HLMONL")) D QUIT:'$D(^TMP($J,"HLMONL")) ;->
. S HLEVIENJ=0
. F S HLEVIENJ=$O(^TMP($J,"HLMON",HLEVIENJ)) Q:'HLEVIENJ D
. . S MONM=$P($G(^TMP($J,"HLMON",+HLEVIENJ,"MONM")),U,3) QUIT:MONM']"" ;->
. . S ^TMP($J,"HLMONL",MONM)=$G(^TMP($J,"HLMONL",MONM))+1
. . S ^TMP($J,"HLMONL",MONM,+HLEVIENJ)=""
;
W !!,"""Runs"" for the following monitors have been found..."
W !!
;
S MONM=""
F S MONM=$O(^TMP($J,"HLMONL",MONM)) Q:MONM']"" D
. S CT=^TMP($J,"HLMONL",MONM),MONM(1)=MONM_"[#"_CT_"]"
. W:$X>40 ! W:$X>1 ?40
. W MONM(1)
;
Q
;
MONVALL ; Collect and build screens for all HLEVIENJs...
N CT,HLEVIENJ
;
KILL ^TMP($J,"HLMON")
;
; Load here...
S HLEVIENJ=0,CT=0
F S HLEVIENJ=$O(^HLEV(776,HLEVIENJ)) Q:HLEVIENJ'>0 D
. D MONALL(+HLEVIENJ)
. S CT=CT+1 W:'(CT#50) "."
;
Q
;
MONALL(HLEVIENJ) ; Build screen for one entry...
N GBL
;
S GBL=$NA(^TMP($J,"HLMON",+HLEVIENJ))
KILL @GBL
;
D MONLOAD^HLEVREP3(+HLEVIENJ) QUIT:'$D(^TMP($J,"HLMON",+HLEVIENJ)) ;->
D MONHHDR(+HLEVIENJ) ; Build HEADER portion of screen
D MONVVAR(+HLEVIENJ) ; Build VARIABLE portion of screen
D MONRRD(+HLEVIENJ) ; Build RUN DIARY portion of screen
D MONMMT(+HLEVIENJ) ; Build MSG TEXT portion of screen
;
Q
;
;
MONHHDR(HLEVIENJ) ; Build header...
; ^TMP($J,"HLMON",+HLEVIENJ) -- req
N TXT
;
D ADDLINE("Start Timestamp Finish Status Appl Mail")
D ADDLINE($$REPEAT^XLFSTR("=",IOM))
;
S TXT=""
D ADD("START",11),ADD("TIME",11),ADD("DONE",11),ADD("STATR",7)
D ADD("MAIL",14)
D ADDLINE(TXT)
;
Q
;
MONVVAR(HLEVIENJ) ; Create screens in ^TMP
; GBL,^TMP($J,"HLMON",+HLEVIENJ) -- req
;
;
N NOPG,NOVAR
;
S X=$G(@GBL@("VX")),NOVAR=$P(X,U),NOPG=$P(X,U,4)
;
; Vertical alignment?
I NOPG>1!(NOVAR<6) D MVSCRNV QUIT ;->
;
; Horizontal alignment...
D MVSCRNH
;
Q
;
MVSCRNV ; Create variable screen VERTICALly...
; Called by MONVSCRN - GBL,HLEVIENJ -- req
N COL,DATA,EXPL,LEN,TXT,VAR,VARX
;
; Get widest variable...
S COL=$O(@GBL@("VY",":"),-1) QUIT:COL'>0 ;->
S VAR=$O(@GBL@("VY",+COL,"ZZZZZZZZZ"),-1) QUIT:VAR']"" ;->
S EXPL=$O(@GBL@("VY",+COL,VAR,"ZZZZZZZZZ"),-1) QUIT:EXPL']"" ;->
S DATA=@GBL@("VD",VAR,EXPL)
S VARX=$S(VAR'=EXPL:EXPL,1:VAR)
;
; Find where 'legend: ' should be...
S TXT=$$CJ^XLFSTR(VARX_"~^~"_DATA,IOM)
S LEN=$L($P(TXT,"~^~"))-2 ; this is critical number...
;
D ADDLINE("")
D ADDLINE($$CJ^XLFSTR("-------------------- Variables ----------------------",IOM))
;
; Loop thru fields now...
S VAR=""
F S VAR=$O(@GBL@("VD",VAR)) Q:VAR']"" D
. S EXPL=""
. F S EXPL=$O(@GBL@("VD",VAR,EXPL)) Q:EXPL']"" D
. . S DATA=@GBL@("VD",VAR,EXPL)
. . S TXT=$$PAD($S(EXPL=VAR:VAR,1:EXPL),LEN)_DATA
. . D ADDLINE(TXT)
;
Q
;
MVSCRNH ; Create variable screen HORIZONTALly... (Only called if PAGE=1)
; Called by MONVSCRN - GBL,HLEVIENJ -- req
N DATA,EXPL,HDR,NO,TXTHDR,TXTVAR
;
D ADDLINE("")
D ADDLINE($$CJ^XLFSTR("-------------------- Variables ----------------------",IOM))
;
; Header
S VAR="",TXTHDR="",NO=0
F S VAR=$O(@GBL@("VD",VAR)) Q:VAR']"" D
. S EXPL=""
. F S EXPL=$O(@GBL@("VD",VAR,EXPL)) Q:EXPL']"" D
. . S HDR=$S(EXPL'=VAR:EXPL,1:VAR)
. . S DATA=@GBL@("VD",VAR,EXPL)
. . S X=$L(HDR),Y=$L(DATA),LEN=$S(X>Y:X,1:Y)
. . S NO=NO+1,NO(NO)=LEN_U_HDR_U_DATA
;
; Header line...
S NO=0,TXTHDR=""
F S NO=$O(NO(NO)) Q:NO'>0 D
. S DATA=NO(+NO)
. S LEN=+DATA,DATA=$P(DATA,U,2)
. S TXTHDR=TXTHDR_$S(TXTHDR]"":" ",1:"")
. S TXTHDR=TXTHDR_$E(DATA_$$REPEAT^XLFSTR(" ",LEN),1,LEN)
D ADDLINE(TXTHDR)
;
D ADDLINE($$REPEAT^XLFSTR("=",IOM))
;
; Variables...
S NO=0,TXTVAR=""
F S NO=$O(NO(NO)) Q:NO'>0 D
. S DATA=NO(+NO)
. S LEN=+DATA,DATA=$P(DATA,U,3)
. S TXTVAR=TXTVAR_$S(TXTVAR]"":" ",1:"")
. S TXTVAR=TXTVAR_$E(DATA_$$REPEAT^XLFSTR(" ",LEN),1,LEN)
D ADDLINE(TXTVAR)
;
Q
;
MONRRD(HLEVIENJ) ; Build RUN DIARY...
; GBL,^TMP($J,"HLMON",+HLEVIENJ) -- req
N NO
;
QUIT:'$D(@GBL@("RUN")) ;->
;
D ADDLINE("")
D ADDLINE($$CJ^XLFSTR("---------------------- Run Diary ------------------------",IOM))
;
S NO=0
S NO=$O(@GBL@("RUN",NO)) Q:NO'>0 D
. D ADDLINE(@GBL@("RUN",+NO))
;
Q
;
;
MONMMT(HLEVIENJ) ; Build MSG TEXT...
; ^TMP($J,"HLMON",+HLEVIENJ) -- req
N NO
;
QUIT:'$D(@GBL@("MSG")) ;->
;
D ADDLINE("")
D ADDLINE($$CJ^XLFSTR("-------------------- Message Text ----------------------",IOM))
;
S NO=0
S NO=$O(@GBL@("MSG",NO)) Q:NO'>0 D
. D ADDLINE(@GBL@("MSG",+NO))
;
Q
;
;
PAD(VAR,COL) ; Make " var: "
QUIT:$L(VAR)>(COL-3) VAR_": " ;->
Q $$REPEAT^XLFSTR(" ",COL-$L(VAR))_VAR_": "
;
ADDLINE(TXT) ; Add line of text...
N NO
S NO=$O(@GBL@("VIEW",":"),-1)+1
S @GBL@("VIEW",+NO)=TXT
Q
;
;
ADD(VAR,COL) ; Add to TXT...
N VAL
S VAL=$P($G(@GBL@(VAR)),U,$S(VAR="STATR":4,1:3))
S TXT=TXT_$S(TXT]"":" ",1:"")_$E(VAL_$$REPEAT^XLFSTR(" ",COL),1,COL)
Q
;
EOR ;HLEVREP2 - Event Monitor REPORTS ;5/16/03 14:42
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLEVREP2 7896 printed Nov 22, 2024@17:07:58 Page 2
HLEVREP2 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
+1 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
+2 ;
CTRL ; Called by 'Display monitor details [HLEV MONITOR DETAILS]'
+1 NEW MONM
+2 ;
+3 KILL ^TMP($JOB)
+4 ;
+5 DO HD
+6 DO EX
+7 WRITE !
+8 ;->
if $$BTE^HLCSMON("Press RETURN to collect data, or enter '^' to exit... ")
QUIT
+9 DO MONVALL
+10 ;
+11 FOR
Begin DoDot:1
+12 DO MONLIST
+13 WRITE !
+14 ;->
SET MONM=$$ASKMON
if MONM']""
QUIT
+15 ;->
SET WAY=$$ORDER
IF WAY'?1N
SET MONM=""
QUIT
+16 IF WAY=1
DO SHOWR(MONM)
+17 IF WAY=2
DO SHOWF(MONM)
+18 DO HD
End DoDot:1
if MONM']""
QUIT
+19 ;
+20 KILL ^TMP($JOB)
+21 ;
+22 QUIT
+23 ;
SHOWF(MONM) ; Show monitors from oldest to newest
+1 NEW ABRT,HLEVIENJ,PMT
+2 WRITE !
+3 SET ABRT=0
SET HLEVIENJ=0
+4 FOR
SET HLEVIENJ=$ORDER(^TMP($JOB,"HLMONL",MONM,HLEVIENJ))
if 'HLEVIENJ!(ABRT)
QUIT
Begin DoDot:1
+5 ;->
SET X=$$NEXT
SET ABRT=$PIECE(X,U,2)
SET PRINT=+X
if ABRT
QUIT
+6 IF PRINT
DO SHOW(HLEVIENJ)
WRITE !
End DoDot:1
+7 QUIT
+8 ;
SHOWR(MONM) ; Show monitors from newest to oldest
+1 NEW ABRT,HLEVIENJ,PRINT,X
+2 WRITE !
+3 SET ABRT=0
SET HLEVIENJ=":"
+4 FOR
SET HLEVIENJ=$ORDER(^TMP($JOB,"HLMONL",MONM,HLEVIENJ),-1)
if 'HLEVIENJ!(ABRT)
QUIT
Begin DoDot:1
+5 ;->
SET X=$$NEXT
SET ABRT=$PIECE(X,U,2)
SET PRINT=+X
if ABRT
QUIT
+6 IF PRINT
DO SHOW(HLEVIENJ)
WRITE !
End DoDot:1
+7 QUIT
+8 ;
NEXT() ; Show next entry?
+1 NEW ANS
+2 SET ANS=$$YN^HLEVUTIL("Display monitor ""run"" started at "_$PIECE(^TMP($JOB,"HLMON",+HLEVIENJ,"START"),U,3),"No")
+3 ;-> Display^Abort
IF ANS=1
QUIT "1^0"
+4 ;->
IF ANS=""
QUIT "0^0"
+5 QUIT "0^1"
+6 ;
SHOW(HLEVIENJ) ; Ask if want to view...
+1 NEW GBL,LINES,MONM
+2 ;
+3 SET GBL=$NAME(^TMP($JOB,"HLMON",HLEVIENJ))
+4 ;
+5 ;
+6 SET LINES=$ORDER(@GBL@("VIEW",":"),-1)
+7 ;->
SET MONM=$PIECE($GET(@GBL@("MONM")),U,3)
if MONM']""
QUIT
+8 SET MONM=MONM_"[#"_HLEVIENJ_"]"
+9 ;
+10 ;->
IF LINES<22
Begin DoDot:1
+11 WRITE @IOF,$$CJ^XLFSTR(MONM,IOM),!,$$REPEAT^XLFSTR("=",IOM)
+12 SET NO=0
+13 FOR
SET NO=$ORDER(^TMP($JOB,"HLMON",+HLEVIENJ,"VIEW",NO))
if NO'>0
QUIT
Begin DoDot:2
+14 WRITE !,^TMP($JOB,"HLMON",+HLEVIENJ,"VIEW",NO)
End DoDot:2
End DoDot:1
QUIT
+15 ;
+16 DO BROWSE^DDBR($NAME(^TMP($JOB,"HLMON",+HLEVIENJ,"VIEW")),"N",MONM)
+17 ;
+18 QUIT
+19 ;
ORDER() ; $ORDER direction...
+1 NEW DIR,DIRUT,DTOUT,DUOUT
+2 SET DIR(0)="S^1:Show entries from newest to oldest;2:Show entries from oldest to newest;3:Exit"
+3 SET DIR("A")="Select display direction"
+4 SET DIR("B")=1
+5 DO ^DIR
+6 QUIT $SELECT(+Y=1!(+Y=2):+Y,1:"")
+7 ;
ASKMON() ; Ask user to select a monitor...
+1 NEW DIC,X,Y
+2 SET DIC=776.1
SET DIC(0)="AEMQ"
SET DIC("A")="Select MONITOR: "
+3 SET DIC("S")="S HLEV=$P($G(^HLEV(776.1,+Y,0)),U) I HLEV]"""",$D(^TMP($J,""HLMONL"",HLEV))"
+4 DO ^DIC
+5 QUIT $SELECT(+Y>0:$PIECE(Y,U,2),1:"")
+6 ;
HD WRITE @IOF,$$CJ^XLFSTR("Display Monitor Details",IOM)
+1 WRITE !,$$REPEAT^XLFSTR("=",IOM)
+2 QUIT
+3 ;
EX NEW I,T
FOR I=1:1
SET T=$TEXT(EX+I)
if T'[";;"
QUIT
WRITE !,$PIECE(T,";;",2,99)
+1 ;;This option displays a detailed view of monitor run-time data. You can loop
+2 ;;through all occurrences of a monitor from oldest to most recent, or from most
+3 ;;recent to oldest.
+4 QUIT
+5 ;
MONLIST ; Create and print list of monitors...
+1 NEW DATA,HLEVIENJ
+2 ;
+3 ;->
IF '$DATA(^TMP($JOB,"HLMONL"))
Begin DoDot:1
+4 SET HLEVIENJ=0
+5 FOR
SET HLEVIENJ=$ORDER(^TMP($JOB,"HLMON",HLEVIENJ))
if 'HLEVIENJ
QUIT
Begin DoDot:2
+6 ;->
SET MONM=$PIECE($GET(^TMP($JOB,"HLMON",+HLEVIENJ,"MONM")),U,3)
if MONM']""
QUIT
+7 SET ^TMP($JOB,"HLMONL",MONM)=$GET(^TMP($JOB,"HLMONL",MONM))+1
+8 SET ^TMP($JOB,"HLMONL",MONM,+HLEVIENJ)=""
End DoDot:2
End DoDot:1
if '$DATA(^TMP($JOB,"HLMONL"))
QUIT
+9 ;
+10 WRITE !!,"""Runs"" for the following monitors have been found..."
+11 WRITE !!
+12 ;
+13 SET MONM=""
+14 FOR
SET MONM=$ORDER(^TMP($JOB,"HLMONL",MONM))
if MONM']""
QUIT
Begin DoDot:1
+15 SET CT=^TMP($JOB,"HLMONL",MONM)
SET MONM(1)=MONM_"[#"_CT_"]"
+16 if $X>40
WRITE !
if $X>1
WRITE ?40
+17 WRITE MONM(1)
End DoDot:1
+18 ;
+19 QUIT
+20 ;
MONVALL ; Collect and build screens for all HLEVIENJs...
+1 NEW CT,HLEVIENJ
+2 ;
+3 KILL ^TMP($JOB,"HLMON")
+4 ;
+5 ; Load here...
+6 SET HLEVIENJ=0
SET CT=0
+7 FOR
SET HLEVIENJ=$ORDER(^HLEV(776,HLEVIENJ))
if HLEVIENJ'>0
QUIT
Begin DoDot:1
+8 DO MONALL(+HLEVIENJ)
+9 SET CT=CT+1
if '(CT#50)
WRITE "."
End DoDot:1
+10 ;
+11 QUIT
+12 ;
MONALL(HLEVIENJ) ; Build screen for one entry...
+1 NEW GBL
+2 ;
+3 SET GBL=$NAME(^TMP($JOB,"HLMON",+HLEVIENJ))
+4 KILL @GBL
+5 ;
+6 ;->
DO MONLOAD^HLEVREP3(+HLEVIENJ)
if '$DATA(^TMP($JOB,"HLMON",+HLEVIENJ))
QUIT
+7 ; Build HEADER portion of screen
DO MONHHDR(+HLEVIENJ)
+8 ; Build VARIABLE portion of screen
DO MONVVAR(+HLEVIENJ)
+9 ; Build RUN DIARY portion of screen
DO MONRRD(+HLEVIENJ)
+10 ; Build MSG TEXT portion of screen
DO MONMMT(+HLEVIENJ)
+11 ;
+12 QUIT
+13 ;
+14 ;
MONHHDR(HLEVIENJ) ; Build header...
+1 ; ^TMP($J,"HLMON",+HLEVIENJ) -- req
+2 NEW TXT
+3 ;
+4 DO ADDLINE("Start Timestamp Finish Status Appl Mail")
+5 DO ADDLINE($$REPEAT^XLFSTR("=",IOM))
+6 ;
+7 SET TXT=""
+8 DO ADD("START",11)
DO ADD("TIME",11)
DO ADD("DONE",11)
DO ADD("STATR",7)
+9 DO ADD("MAIL",14)
+10 DO ADDLINE(TXT)
+11 ;
+12 QUIT
+13 ;
MONVVAR(HLEVIENJ) ; Create screens in ^TMP
+1 ; GBL,^TMP($J,"HLMON",+HLEVIENJ) -- req
+2 ;
+3 ;
+4 NEW NOPG,NOVAR
+5 ;
+6 SET X=$GET(@GBL@("VX"))
SET NOVAR=$PIECE(X,U)
SET NOPG=$PIECE(X,U,4)
+7 ;
+8 ; Vertical alignment?
+9 ;->
IF NOPG>1!(NOVAR<6)
DO MVSCRNV
QUIT
+10 ;
+11 ; Horizontal alignment...
+12 DO MVSCRNH
+13 ;
+14 QUIT
+15 ;
MVSCRNV ; Create variable screen VERTICALly...
+1 ; Called by MONVSCRN - GBL,HLEVIENJ -- req
+2 NEW COL,DATA,EXPL,LEN,TXT,VAR,VARX
+3 ;
+4 ; Get widest variable...
+5 ;->
SET COL=$ORDER(@GBL@("VY",":"),-1)
if COL'>0
QUIT
+6 ;->
SET VAR=$ORDER(@GBL@("VY",+COL,"ZZZZZZZZZ"),-1)
if VAR']""
QUIT
+7 ;->
SET EXPL=$ORDER(@GBL@("VY",+COL,VAR,"ZZZZZZZZZ"),-1)
if EXPL']""
QUIT
+8 SET DATA=@GBL@("VD",VAR,EXPL)
+9 SET VARX=$SELECT(VAR'=EXPL:EXPL,1:VAR)
+10 ;
+11 ; Find where 'legend: ' should be...
+12 SET TXT=$$CJ^XLFSTR(VARX_"~^~"_DATA,IOM)
+13 ; this is critical number...
SET LEN=$LENGTH($PIECE(TXT,"~^~"))-2
+14 ;
+15 DO ADDLINE("")
+16 DO ADDLINE($$CJ^XLFSTR("-------------------- Variables ----------------------",IOM))
+17 ;
+18 ; Loop thru fields now...
+19 SET VAR=""
+20 FOR
SET VAR=$ORDER(@GBL@("VD",VAR))
if VAR']""
QUIT
Begin DoDot:1
+21 SET EXPL=""
+22 FOR
SET EXPL=$ORDER(@GBL@("VD",VAR,EXPL))
if EXPL']""
QUIT
Begin DoDot:2
+23 SET DATA=@GBL@("VD",VAR,EXPL)
+24 SET TXT=$$PAD($SELECT(EXPL=VAR:VAR,1:EXPL),LEN)_DATA
+25 DO ADDLINE(TXT)
End DoDot:2
End DoDot:1
+26 ;
+27 QUIT
+28 ;
MVSCRNH ; Create variable screen HORIZONTALly... (Only called if PAGE=1)
+1 ; Called by MONVSCRN - GBL,HLEVIENJ -- req
+2 NEW DATA,EXPL,HDR,NO,TXTHDR,TXTVAR
+3 ;
+4 DO ADDLINE("")
+5 DO ADDLINE($$CJ^XLFSTR("-------------------- Variables ----------------------",IOM))
+6 ;
+7 ; Header
+8 SET VAR=""
SET TXTHDR=""
SET NO=0
+9 FOR
SET VAR=$ORDER(@GBL@("VD",VAR))
if VAR']""
QUIT
Begin DoDot:1
+10 SET EXPL=""
+11 FOR
SET EXPL=$ORDER(@GBL@("VD",VAR,EXPL))
if EXPL']""
QUIT
Begin DoDot:2
+12 SET HDR=$SELECT(EXPL'=VAR:EXPL,1:VAR)
+13 SET DATA=@GBL@("VD",VAR,EXPL)
+14 SET X=$LENGTH(HDR)
SET Y=$LENGTH(DATA)
SET LEN=$SELECT(X>Y:X,1:Y)
+15 SET NO=NO+1
SET NO(NO)=LEN_U_HDR_U_DATA
End DoDot:2
End DoDot:1
+16 ;
+17 ; Header line...
+18 SET NO=0
SET TXTHDR=""
+19 FOR
SET NO=$ORDER(NO(NO))
if NO'>0
QUIT
Begin DoDot:1
+20 SET DATA=NO(+NO)
+21 SET LEN=+DATA
SET DATA=$PIECE(DATA,U,2)
+22 SET TXTHDR=TXTHDR_$SELECT(TXTHDR]"":" ",1:"")
+23 SET TXTHDR=TXTHDR_$EXTRACT(DATA_$$REPEAT^XLFSTR(" ",LEN),1,LEN)
End DoDot:1
+24 DO ADDLINE(TXTHDR)
+25 ;
+26 DO ADDLINE($$REPEAT^XLFSTR("=",IOM))
+27 ;
+28 ; Variables...
+29 SET NO=0
SET TXTVAR=""
+30 FOR
SET NO=$ORDER(NO(NO))
if NO'>0
QUIT
Begin DoDot:1
+31 SET DATA=NO(+NO)
+32 SET LEN=+DATA
SET DATA=$PIECE(DATA,U,3)
+33 SET TXTVAR=TXTVAR_$SELECT(TXTVAR]"":" ",1:"")
+34 SET TXTVAR=TXTVAR_$EXTRACT(DATA_$$REPEAT^XLFSTR(" ",LEN),1,LEN)
End DoDot:1
+35 DO ADDLINE(TXTVAR)
+36 ;
+37 QUIT
+38 ;
MONRRD(HLEVIENJ) ; Build RUN DIARY...
+1 ; GBL,^TMP($J,"HLMON",+HLEVIENJ) -- req
+2 NEW NO
+3 ;
+4 ;->
if '$DATA(@GBL@("RUN"))
QUIT
+5 ;
+6 DO ADDLINE("")
+7 DO ADDLINE($$CJ^XLFSTR("---------------------- Run Diary ------------------------",IOM))
+8 ;
+9 SET NO=0
+10 SET NO=$ORDER(@GBL@("RUN",NO))
if NO'>0
QUIT
Begin DoDot:1
+11 DO ADDLINE(@GBL@("RUN",+NO))
End DoDot:1
+12 ;
+13 QUIT
+14 ;
+15 ;
MONMMT(HLEVIENJ) ; Build MSG TEXT...
+1 ; ^TMP($J,"HLMON",+HLEVIENJ) -- req
+2 NEW NO
+3 ;
+4 ;->
if '$DATA(@GBL@("MSG"))
QUIT
+5 ;
+6 DO ADDLINE("")
+7 DO ADDLINE($$CJ^XLFSTR("-------------------- Message Text ----------------------",IOM))
+8 ;
+9 SET NO=0
+10 SET NO=$ORDER(@GBL@("MSG",NO))
if NO'>0
QUIT
Begin DoDot:1
+11 DO ADDLINE(@GBL@("MSG",+NO))
End DoDot:1
+12 ;
+13 QUIT
+14 ;
+15 ;
PAD(VAR,COL) ; Make " var: "
+1 ;->
if $LENGTH(VAR)>(COL-3)
QUIT VAR_": "
+2 QUIT $$REPEAT^XLFSTR(" ",COL-$LENGTH(VAR))_VAR_": "
+3 ;
ADDLINE(TXT) ; Add line of text...
+1 NEW NO
+2 SET NO=$ORDER(@GBL@("VIEW",":"),-1)+1
+3 SET @GBL@("VIEW",+NO)=TXT
+4 QUIT
+5 ;
+6 ;
ADD(VAR,COL) ; Add to TXT...
+1 NEW VAL
+2 SET VAL=$PIECE($GET(@GBL@(VAR)),U,$SELECT(VAR="STATR":4,1:3))
+3 SET TXT=TXT_$SELECT(TXT]"":" ",1:"")_$EXTRACT(VAL_$$REPEAT^XLFSTR(" ",COL),1,COL)
+4 QUIT
+5 ;
EOR ;HLEVREP2 - Event Monitor REPORTS ;5/16/03 14:42