HLEVREP1 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
;
CTRL ; Menu map display...
N CT,DATE,DATEFRST,DATELAST,DATENXT,DATESEL,IOINHI,IOINORM
N LINE,NO,TXT,X,Y
;
S X="IOINHI;IOINORM" D ENDR^%ZISS
;
KILL ^TMP($J,"HLMAP")
D HD("Event Monitor Display")
D EX
D PURGING
W !
QUIT:$$BTE^HLCSMON("Press RETURN to collect data, or '^' to exit... ") ;->
W !!,"Collecting..."
D MAPALL
D MONVALL^HLEVREP2
;
I '$D(^TMP($J,"HLMAP","S","D")) D QUIT ;->
. D TELL^HLEVMST0("No data exists!","1^2^999")
;
S DATEFRST=$O(^TMP($J,"HLMAP","S","D",0))
S (DATELAST,DATENXT)=$O(^TMP($J,"HLMAP","S","D",":"),-1)
;
W !!,"Data found for ",$$FMTE^XLFDT(DATEFRST)
I DATELAST=DATEFRST W "."
I DATELAST'=DATEFRST W " to ",$$FMTE^XLFDT(DATELAST),"."
W !!,"Loading most recent date..."
;
H 2
;
S CT=0
F D QUIT:DATE']"" ;->
. S CT=CT+1
. S (DATE,DATESEL)=$S(CT=1:DATELAST,1:$$MAPDATE(DATENXT)) QUIT:DATE'?7N ;->
. S DATENXT=$$FMADD^XLFDT(DATE,-1) ; Next date to be prompted...
. S TXT="Event Monitor Map - "_$$FMTE^XLFDT(DATE)
. S LINE=$O(^TMP($J,"HLMAP","S","D",DATE,":"),-1)
. I LINE<22 D
. . W @IOF,$$CJ^XLFSTR(TXT,IOM),!,$$REPEAT^XLFSTR("=",IOM)
. . S NO=0
. . F S NO=$O(^TMP($J,"HLMAP","S","D",DATE,NO)) Q:'NO D
. . . W !,^TMP($J,"HLMAP","S","D",DATE,NO)
. I LINE'<22 D
. . D BROWSE^DDBR("^TMP($J,""HLMAP"",""S"",""D"","_DATE_")","N",TXT)
. D CTRLMON^HLEVREP3 ; All user to call up individual monitor run info...
. I DATENXT<DATEFRST D QUIT ;->
. . W !!,"You just viewed the ",IOINHI,"earliest",IOINORM
. . W " day on record. (You must manually enter the"
. . W !,"next date to view.)"
. . W !
. . S DATENXT=""
. I DATENXT=DATEFRST D QUIT ;->
. . W !!,$$FMTE^XLFDT(DATENXT)," is the earliest date on record."
. . W !
. W !!,"The next earlier date is prompted below."
. W !
;
Q
;
MAPDEVCE ; Just dump to screen...
N ABRT,CT,DAY,NO,X
S DAY=0,ABRT=0,CT=0
F S DAY=$O(^TMP($J,"HLMAP","S","D",DAY)) Q:'DAY!(ABRT) D
. W !!,$$CJ^XLFSTR(" Event Monitor Information - "_$$FMTE^XLFDT(DAY)_" ",IOM,"=")
. S CT=CT+2
. S NO=0
. F S NO=$O(^TMP($J,"HLMAP","S","D",DAY,NO)) Q:NO'>0 D
. . S CT=CT+1
. . W !,^TMP($J,"HLMAP","S","D",DAY,NO)
. . QUIT:CT<22 ;->
. . R X:999 S CT=0
R:CT X:999
Q
;
MAPDATE(DATEPMT) ; Select date...
N ANS,DIR,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)="DO^"_DATEFRST_":"_DATELAST_":EX"
S DIR("A")="Select DATE",DIR("?")="Enter a report date, (but don't enter time of day.)"
I $G(DATEPMT)?7N S DIR("B")=$$FMTE^XLFDT(DATEPMT)
D ^DIR
QUIT:+Y?7N +Y ;->
S ANS=Y
I $$UP^XLFSTR($TR(X," ",""))["DUMP" D MAPDEVCE ;->
Q ""
;
PURGING ; How for back does purging start?
N DATA,PURGEHR
S PURGEHR=$P($G(^HLEV(776.999,1,0)),U,4)
S PURGEHR=$S(PURGEHR:PURGEHR,1:96)
W !!,$$CJ^XLFSTR("--- Data before NOW-"_PURGEHR_" hours has been deleted ---",IOM)
Q
;
HD(TXT) W @IOF,$$CJ^XLFSTR(TXT,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 collects all existing event monitor information for review. You
;;can view a "map" of each monitor that ran, showing hour-by-hour when the
;;"run" occurred. You may also select individual monitors for a more detailed
;;display.
QUIT
;
MAPALL ; Do everything to get ^TMP($J,"HLMAP") data ready for printing...
KILL ^TMP($J,"HLMAP")
D MAPCOLLE ; Find events...
D MAPCOLLM ; Find master job runs
D MAPBUILD ; Build date array
D MAPSCRN ; Build daily screens
Q
;
MAPCOLLM ; Collect map ^TMP data - Master job runs...
N DATA,IENM,MONM,STAT,TIME
S IENM=0
F S IENM=$O(^HLEV(776.2,IENM)) Q:'IENM D
. S DATA=$G(^HLEV(776.2,IENM,0)) QUIT:$P(DATA,U)']"" ;->
. S STAT=$P(DATA,U,4) QUIT:STAT'="F" ;->
. S TIME=$$ROUNDHR(+$P(DATA,U,2)) QUIT:TIME']"" ;->
. S ^TMP($J,"HLMAP","T")=$G(^TMP($J,"HLMAP","T"))+1
. S ^TMP($J,"HLMAP","T","M")=$G(^TMP($J,"HLMAP","T","M"))+1
. S ^TMP($J,"HLMAP","D",TIME,"M")=$G(^TMP($J,"HLMAP","D",TIME,"M"))+1
. S ^TMP($J,"HLMAP","D",TIME,"M",IENM)=""
Q
;
MAPCOLLE ; Collect map ^TMP data - Events...
N DATA,IENM,IENMST,MONIEN,MONM,STAT,TIME
S IENM=0
F S IENM=$O(^HLEV(776,IENM)) Q:'IENM D
. S DATA=$G(^HLEV(776,IENM,0)) QUIT:$P(DATA,U)']"" ;->
. S STAT=$P(DATA,U,4) QUIT:STAT'="F"
. S TIME=$$ROUNDHR(+DATA) QUIT:TIME']"" ;->
. S MONIEN=$P(DATA,U,3) QUIT:MONIEN'>0 ;->
. S MONIEN=MONIEN QUIT:MONIEN'>0 ;->
. S MONM=$P($G(^HLEV(776.1,+MONIEN,0)),U) QUIT:MONM']"" ;->
. S MONM=MONM_"["_MONIEN_"]"
. S IENMST=$P(DATA,U,9),IENMST=$S(IENMST>0:IENMST,1:9999999)
. S ^TMP($J,"HLMAP","T")=$G(^TMP($J,"HLMAP","T"))+1
. S ^TMP($J,"HLMAP","T","E")=$G(^TMP($J,"HLMAP","T","E"))+1
. S ^TMP($J,"HLMAP","D",TIME,"E")=$G(^TMP($J,"HLMAP","D",TIME,"E"))+1
. S ^TMP($J,"HLMAP","D",TIME,"E",MONM)=$G(^TMP($J,"HLMAP","D",TIME,"E",MONM))+1
. S ^TMP($J,"HLMAP","D",TIME,"E",MONM,IENMST,IENM)=""
. S MONM=$P(MONM,"[") QUIT:MONM']"" ;->
. S ^TMP($J,"HLMAP","E",+MONIEN,+TIME\1,+IENM)=MONM
Q
;
MAPBUILD ; Make lines for browsing report
N EVNM,GBL,HOUR
S GBL=$NA(^TMP($J,"HLMAP","D"))
S HOUR=""
F S HOUR=$O(@GBL@(HOUR)) Q:HOUR']"" D
. I $O(@GBL@(HOUR,"M",0))>0 D MAPHOUR("MASTER JOB",HOUR)
. S EVNM=""
. F S EVNM=$O(@GBL@(HOUR,"E",EVNM)) Q:EVNM']"" D
. . D MAPHOUR(EVNM,HOUR)
Q
;
MAPHOUR(EVNM,HOUR) ; Store in display global...
S ^TMP($J,"HLMAP","M",EVNM,+$P(HOUR,"."),+$P(HOUR,".",2))=""
Q
;
MAPSCRN ; Build screen for days...
N DATA,DAY,EVNM,HOUR,HR,TXT,X
;
S EVNM=""
F S EVNM=$O(^TMP($J,"HLMAP","M",EVNM)) Q:EVNM']"" D
. S DAY=0
. F S DAY=$O(^TMP($J,"HLMAP","M",EVNM,DAY)) Q:DAY'>0 D
. . S TXT=$$EVNM(EVNM,31)
. . F HOUR=1:1:24 D
. . . S DATA=$S($D(^TMP($J,"HLMAP","M",EVNM,DAY,HOUR_0)):1,1:0)
. . . S TXT=TXT_$S(DATA:"-X",1:"--")
. . S ^TMP($J,"HLMAP","X",DAY,EVNM)=TXT
;
S DAY=0
F S DAY=$O(^TMP($J,"HLMAP","X",DAY)) Q:DAY'>0 D
. D ADDHDR(DAY)
. I $D(^TMP($J,"HLMAP","X",DAY,"MASTER JOB")) D
. . D ADDLINE(DAY,^TMP($J,"HLMAP","X",DAY,"MASTER JOB"))
. S EVNM=""
. F S EVNM=$O(^TMP($J,"HLMAP","X",DAY,EVNM)) Q:EVNM']"" D
. . QUIT:EVNM="MASTER JOB" ;->
. . D ADDLINE(DAY,^TMP($J,"HLMAP","X",DAY,EVNM))
;
Q
;
ADDHDR(DAY) ; Add HDR code...
D ADDLINE(DAY,$$CJ^XLFSTR(" "_$$FMTE^XLFDT(DAY)_" ",IOM,"="))
D ADDLINE(DAY," |"_IOINHI_" Hours "_IOINORM_"| - 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2")
D ADDLINE(DAY,"Monitor |"_IOINHI_" in Day "_IOINORM_"| - 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4")
D ADDLINE(DAY,$$REPEAT^XLFSTR("=",IOM))
Q
;
ADDLINE(DAY,TXT) ; Add one line of text to screen ^TMP global
N NO
S ^TMP($J,"HLMAP","S","D",DAY)=$G(^TMP($J,"HLMAP","S","D",DAY))+1
S NO=$O(^TMP($J,"HLMAP","S","D",DAY,":"),-1)+1
I '(NO#24) D ; Mid-screen extra header
. S ^TMP($J,"HLMAP","S","D",DAY,NO)=$$REPEAT^XLFSTR("-",IOM)
. S NO=NO+1,^TMP($J,"HLMAP","S","D",DAY,NO)=" Hours - 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2"
. S NO=NO+1,^TMP($J,"HLMAP","S","D",DAY,NO)="Monitor in Day - 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4"
. S NO=NO+1,^TMP($J,"HLMAP","S","D",DAY,NO)=$$REPEAT^XLFSTR("-",IOM)
. S NO=NO+1
S ^TMP($J,"HLMAP","S","D",DAY,+NO)=TXT
Q
;
EVNM(EVNM,LEN) ; Convert event name[ien] to LENgth, truncating name part prn
N IEN,NM,X
I EVNM="MASTER JOB" QUIT $$REPEAT^XLFSTR("-",LEN-$L("MASTER JOB")-1)_"MASTER JOB-" ;->
S NM=$P(EVNM,"["),IEN="["_$P(EVNM,"[",2,99)
S NM(1)=$E(NM,1,LEN-$L(IEN))
I NM'=NM(1) S NM(1)=$E(NM(1),1,$L(NM(1))-1)_"~"
S NM=NM(1)_IEN
S NM=$E(NM_$$REPEAT^XLFSTR("-",LEN),1,LEN)
Q NM
;
ROUNDHR(FM) ;
N HR
S FM=$G(FM)
I FM'?7N&(FM'?7N1"."1.N) QUIT "" ;->
S:FM?7N FM=FM_"." S FM=$E(FM_"00",1,10)
S HR=+$P(FM,".",2)+1 S:HR<10 HR=0_HR
S FM=FM\1_"."_HR_0
Q FM
;
EOR ;HLEVREP1 - Event Monitor REPORTS ;5/16/03 14:42
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLEVREP1 8106 printed Dec 13, 2024@01:57:50 Page 2
HLEVREP1 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
+1 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
+2 ;
CTRL ; Menu map display...
+1 NEW CT,DATE,DATEFRST,DATELAST,DATENXT,DATESEL,IOINHI,IOINORM
+2 NEW LINE,NO,TXT,X,Y
+3 ;
+4 SET X="IOINHI;IOINORM"
DO ENDR^%ZISS
+5 ;
+6 KILL ^TMP($JOB,"HLMAP")
+7 DO HD("Event Monitor Display")
+8 DO EX
+9 DO PURGING
+10 WRITE !
+11 ;->
if $$BTE^HLCSMON("Press RETURN to collect data, or '^' to exit... ")
QUIT
+12 WRITE !!,"Collecting..."
+13 DO MAPALL
+14 DO MONVALL^HLEVREP2
+15 ;
+16 ;->
IF '$DATA(^TMP($JOB,"HLMAP","S","D"))
Begin DoDot:1
+17 DO TELL^HLEVMST0("No data exists!","1^2^999")
End DoDot:1
QUIT
+18 ;
+19 SET DATEFRST=$ORDER(^TMP($JOB,"HLMAP","S","D",0))
+20 SET (DATELAST,DATENXT)=$ORDER(^TMP($JOB,"HLMAP","S","D",":"),-1)
+21 ;
+22 WRITE !!,"Data found for ",$$FMTE^XLFDT(DATEFRST)
+23 IF DATELAST=DATEFRST
WRITE "."
+24 IF DATELAST'=DATEFRST
WRITE " to ",$$FMTE^XLFDT(DATELAST),"."
+25 WRITE !!,"Loading most recent date..."
+26 ;
+27 HANG 2
+28 ;
+29 SET CT=0
+30 ;->
FOR
Begin DoDot:1
+31 SET CT=CT+1
+32 ;->
SET (DATE,DATESEL)=$SELECT(CT=1:DATELAST,1:$$MAPDATE(DATENXT))
if DATE'?7N
QUIT
+33 ; Next date to be prompted...
SET DATENXT=$$FMADD^XLFDT(DATE,-1)
+34 SET TXT="Event Monitor Map - "_$$FMTE^XLFDT(DATE)
+35 SET LINE=$ORDER(^TMP($JOB,"HLMAP","S","D",DATE,":"),-1)
+36 IF LINE<22
Begin DoDot:2
+37 WRITE @IOF,$$CJ^XLFSTR(TXT,IOM),!,$$REPEAT^XLFSTR("=",IOM)
+38 SET NO=0
+39 FOR
SET NO=$ORDER(^TMP($JOB,"HLMAP","S","D",DATE,NO))
if 'NO
QUIT
Begin DoDot:3
+40 WRITE !,^TMP($JOB,"HLMAP","S","D",DATE,NO)
End DoDot:3
End DoDot:2
+41 IF LINE'<22
Begin DoDot:2
+42 DO BROWSE^DDBR("^TMP($J,""HLMAP"",""S"",""D"","_DATE_")","N",TXT)
End DoDot:2
+43 ; All user to call up individual monitor run info...
DO CTRLMON^HLEVREP3
+44 ;->
IF DATENXT<DATEFRST
Begin DoDot:2
+45 WRITE !!,"You just viewed the ",IOINHI,"earliest",IOINORM
+46 WRITE " day on record. (You must manually enter the"
+47 WRITE !,"next date to view.)"
+48 WRITE !
+49 SET DATENXT=""
End DoDot:2
QUIT
+50 ;->
IF DATENXT=DATEFRST
Begin DoDot:2
+51 WRITE !!,$$FMTE^XLFDT(DATENXT)," is the earliest date on record."
+52 WRITE !
End DoDot:2
QUIT
+53 WRITE !!,"The next earlier date is prompted below."
+54 WRITE !
End DoDot:1
if DATE']""
QUIT
+55 ;
+56 QUIT
+57 ;
MAPDEVCE ; Just dump to screen...
+1 NEW ABRT,CT,DAY,NO,X
+2 SET DAY=0
SET ABRT=0
SET CT=0
+3 FOR
SET DAY=$ORDER(^TMP($JOB,"HLMAP","S","D",DAY))
if 'DAY!(ABRT)
QUIT
Begin DoDot:1
+4 WRITE !!,$$CJ^XLFSTR(" Event Monitor Information - "_$$FMTE^XLFDT(DAY)_" ",IOM,"=")
+5 SET CT=CT+2
+6 SET NO=0
+7 FOR
SET NO=$ORDER(^TMP($JOB,"HLMAP","S","D",DAY,NO))
if NO'>0
QUIT
Begin DoDot:2
+8 SET CT=CT+1
+9 WRITE !,^TMP($JOB,"HLMAP","S","D",DAY,NO)
+10 ;->
if CT<22
QUIT
+11 READ X:999
SET CT=0
End DoDot:2
End DoDot:1
+12 if CT
READ X:999
+13 QUIT
+14 ;
MAPDATE(DATEPMT) ; Select date...
+1 NEW ANS,DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 SET DIR(0)="DO^"_DATEFRST_":"_DATELAST_":EX"
+3 SET DIR("A")="Select DATE"
SET DIR("?")="Enter a report date, (but don't enter time of day.)"
+4 IF $GET(DATEPMT)?7N
SET DIR("B")=$$FMTE^XLFDT(DATEPMT)
+5 DO ^DIR
+6 ;->
if +Y?7N
QUIT +Y
+7 SET ANS=Y
+8 ;->
IF $$UP^XLFSTR($TRANSLATE(X," ",""))["DUMP"
DO MAPDEVCE
+9 QUIT ""
+10 ;
PURGING ; How for back does purging start?
+1 NEW DATA,PURGEHR
+2 SET PURGEHR=$PIECE($GET(^HLEV(776.999,1,0)),U,4)
+3 SET PURGEHR=$SELECT(PURGEHR:PURGEHR,1:96)
+4 WRITE !!,$$CJ^XLFSTR("--- Data before NOW-"_PURGEHR_" hours has been deleted ---",IOM)
+5 QUIT
+6 ;
HD(TXT) WRITE @IOF,$$CJ^XLFSTR(TXT,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 collects all existing event monitor information for review. You
+2 ;;can view a "map" of each monitor that ran, showing hour-by-hour when the
+3 ;;"run" occurred. You may also select individual monitors for a more detailed
+4 ;;display.
+5 QUIT
+6 ;
MAPALL ; Do everything to get ^TMP($J,"HLMAP") data ready for printing...
+1 KILL ^TMP($JOB,"HLMAP")
+2 ; Find events...
DO MAPCOLLE
+3 ; Find master job runs
DO MAPCOLLM
+4 ; Build date array
DO MAPBUILD
+5 ; Build daily screens
DO MAPSCRN
+6 QUIT
+7 ;
MAPCOLLM ; Collect map ^TMP data - Master job runs...
+1 NEW DATA,IENM,MONM,STAT,TIME
+2 SET IENM=0
+3 FOR
SET IENM=$ORDER(^HLEV(776.2,IENM))
if 'IENM
QUIT
Begin DoDot:1
+4 ;->
SET DATA=$GET(^HLEV(776.2,IENM,0))
if $PIECE(DATA,U)']""
QUIT
+5 ;->
SET STAT=$PIECE(DATA,U,4)
if STAT'="F"
QUIT
+6 ;->
SET TIME=$$ROUNDHR(+$PIECE(DATA,U,2))
if TIME']""
QUIT
+7 SET ^TMP($JOB,"HLMAP","T")=$GET(^TMP($JOB,"HLMAP","T"))+1
+8 SET ^TMP($JOB,"HLMAP","T","M")=$GET(^TMP($JOB,"HLMAP","T","M"))+1
+9 SET ^TMP($JOB,"HLMAP","D",TIME,"M")=$GET(^TMP($JOB,"HLMAP","D",TIME,"M"))+1
+10 SET ^TMP($JOB,"HLMAP","D",TIME,"M",IENM)=""
End DoDot:1
+11 QUIT
+12 ;
MAPCOLLE ; Collect map ^TMP data - Events...
+1 NEW DATA,IENM,IENMST,MONIEN,MONM,STAT,TIME
+2 SET IENM=0
+3 FOR
SET IENM=$ORDER(^HLEV(776,IENM))
if 'IENM
QUIT
Begin DoDot:1
+4 ;->
SET DATA=$GET(^HLEV(776,IENM,0))
if $PIECE(DATA,U)']""
QUIT
+5 SET STAT=$PIECE(DATA,U,4)
if STAT'="F"
QUIT
+6 ;->
SET TIME=$$ROUNDHR(+DATA)
if TIME']""
QUIT
+7 ;->
SET MONIEN=$PIECE(DATA,U,3)
if MONIEN'>0
QUIT
+8 ;->
SET MONIEN=MONIEN
if MONIEN'>0
QUIT
+9 ;->
SET MONM=$PIECE($GET(^HLEV(776.1,+MONIEN,0)),U)
if MONM']""
QUIT
+10 SET MONM=MONM_"["_MONIEN_"]"
+11 SET IENMST=$PIECE(DATA,U,9)
SET IENMST=$SELECT(IENMST>0:IENMST,1:9999999)
+12 SET ^TMP($JOB,"HLMAP","T")=$GET(^TMP($JOB,"HLMAP","T"))+1
+13 SET ^TMP($JOB,"HLMAP","T","E")=$GET(^TMP($JOB,"HLMAP","T","E"))+1
+14 SET ^TMP($JOB,"HLMAP","D",TIME,"E")=$GET(^TMP($JOB,"HLMAP","D",TIME,"E"))+1
+15 SET ^TMP($JOB,"HLMAP","D",TIME,"E",MONM)=$GET(^TMP($JOB,"HLMAP","D",TIME,"E",MONM))+1
+16 SET ^TMP($JOB,"HLMAP","D",TIME,"E",MONM,IENMST,IENM)=""
+17 ;->
SET MONM=$PIECE(MONM,"[")
if MONM']""
QUIT
+18 SET ^TMP($JOB,"HLMAP","E",+MONIEN,+TIME\1,+IENM)=MONM
End DoDot:1
+19 QUIT
+20 ;
MAPBUILD ; Make lines for browsing report
+1 NEW EVNM,GBL,HOUR
+2 SET GBL=$NAME(^TMP($JOB,"HLMAP","D"))
+3 SET HOUR=""
+4 FOR
SET HOUR=$ORDER(@GBL@(HOUR))
if HOUR']""
QUIT
Begin DoDot:1
+5 IF $ORDER(@GBL@(HOUR,"M",0))>0
DO MAPHOUR("MASTER JOB",HOUR)
+6 SET EVNM=""
+7 FOR
SET EVNM=$ORDER(@GBL@(HOUR,"E",EVNM))
if EVNM']""
QUIT
Begin DoDot:2
+8 DO MAPHOUR(EVNM,HOUR)
End DoDot:2
End DoDot:1
+9 QUIT
+10 ;
MAPHOUR(EVNM,HOUR) ; Store in display global...
+1 SET ^TMP($JOB,"HLMAP","M",EVNM,+$PIECE(HOUR,"."),+$PIECE(HOUR,".",2))=""
+2 QUIT
+3 ;
MAPSCRN ; Build screen for days...
+1 NEW DATA,DAY,EVNM,HOUR,HR,TXT,X
+2 ;
+3 SET EVNM=""
+4 FOR
SET EVNM=$ORDER(^TMP($JOB,"HLMAP","M",EVNM))
if EVNM']""
QUIT
Begin DoDot:1
+5 SET DAY=0
+6 FOR
SET DAY=$ORDER(^TMP($JOB,"HLMAP","M",EVNM,DAY))
if DAY'>0
QUIT
Begin DoDot:2
+7 SET TXT=$$EVNM(EVNM,31)
+8 FOR HOUR=1:1:24
Begin DoDot:3
+9 SET DATA=$SELECT($DATA(^TMP($JOB,"HLMAP","M",EVNM,DAY,HOUR_0)):1,1:0)
+10 SET TXT=TXT_$SELECT(DATA:"-X",1:"--")
End DoDot:3
+11 SET ^TMP($JOB,"HLMAP","X",DAY,EVNM)=TXT
End DoDot:2
End DoDot:1
+12 ;
+13 SET DAY=0
+14 FOR
SET DAY=$ORDER(^TMP($JOB,"HLMAP","X",DAY))
if DAY'>0
QUIT
Begin DoDot:1
+15 DO ADDHDR(DAY)
+16 IF $DATA(^TMP($JOB,"HLMAP","X",DAY,"MASTER JOB"))
Begin DoDot:2
+17 DO ADDLINE(DAY,^TMP($JOB,"HLMAP","X",DAY,"MASTER JOB"))
End DoDot:2
+18 SET EVNM=""
+19 FOR
SET EVNM=$ORDER(^TMP($JOB,"HLMAP","X",DAY,EVNM))
if EVNM']""
QUIT
Begin DoDot:2
+20 ;->
if EVNM="MASTER JOB"
QUIT
+21 DO ADDLINE(DAY,^TMP($JOB,"HLMAP","X",DAY,EVNM))
End DoDot:2
End DoDot:1
+22 ;
+23 QUIT
+24 ;
ADDHDR(DAY) ; Add HDR code...
+1 DO ADDLINE(DAY,$$CJ^XLFSTR(" "_$$FMTE^XLFDT(DAY)_" ",IOM,"="))
+2 DO ADDLINE(DAY," |"_IOINHI_" Hours "_IOINORM_"| - 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2")
+3 DO ADDLINE(DAY,"Monitor |"_IOINHI_" in Day "_IOINORM_"| - 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4")
+4 DO ADDLINE(DAY,$$REPEAT^XLFSTR("=",IOM))
+5 QUIT
+6 ;
ADDLINE(DAY,TXT) ; Add one line of text to screen ^TMP global
+1 NEW NO
+2 SET ^TMP($JOB,"HLMAP","S","D",DAY)=$GET(^TMP($JOB,"HLMAP","S","D",DAY))+1
+3 SET NO=$ORDER(^TMP($JOB,"HLMAP","S","D",DAY,":"),-1)+1
+4 ; Mid-screen extra header
IF '(NO#24)
Begin DoDot:1
+5 SET ^TMP($JOB,"HLMAP","S","D",DAY,NO)=$$REPEAT^XLFSTR("-",IOM)
+6 SET NO=NO+1
SET ^TMP($JOB,"HLMAP","S","D",DAY,NO)=" Hours - 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2"
+7 SET NO=NO+1
SET ^TMP($JOB,"HLMAP","S","D",DAY,NO)="Monitor in Day - 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4"
+8 SET NO=NO+1
SET ^TMP($JOB,"HLMAP","S","D",DAY,NO)=$$REPEAT^XLFSTR("-",IOM)
+9 SET NO=NO+1
End DoDot:1
+10 SET ^TMP($JOB,"HLMAP","S","D",DAY,+NO)=TXT
+11 QUIT
+12 ;
EVNM(EVNM,LEN) ; Convert event name[ien] to LENgth, truncating name part prn
+1 NEW IEN,NM,X
+2 ;->
IF EVNM="MASTER JOB"
QUIT $$REPEAT^XLFSTR("-",LEN-$LENGTH("MASTER JOB")-1)_"MASTER JOB-"
+3 SET NM=$PIECE(EVNM,"[")
SET IEN="["_$PIECE(EVNM,"[",2,99)
+4 SET NM(1)=$EXTRACT(NM,1,LEN-$LENGTH(IEN))
+5 IF NM'=NM(1)
SET NM(1)=$EXTRACT(NM(1),1,$LENGTH(NM(1))-1)_"~"
+6 SET NM=NM(1)_IEN
+7 SET NM=$EXTRACT(NM_$$REPEAT^XLFSTR("-",LEN),1,LEN)
+8 QUIT NM
+9 ;
ROUNDHR(FM) ;
+1 NEW HR
+2 SET FM=$GET(FM)
+3 ;->
IF FM'?7N&(FM'?7N1"."1.N)
QUIT ""
+4 if FM?7N
SET FM=FM_"."
SET FM=$EXTRACT(FM_"00",1,10)
+5 SET HR=+$PIECE(FM,".",2)+1
if HR<10
SET HR=0_HR
+6 SET FM=FM\1_"."_HR_0
+7 QUIT FM
+8 ;
EOR ;HLEVREP1 - Event Monitor REPORTS ;5/16/03 14:42