HLEVREP0 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
;
RECIP ; Called by [HLEV REPORT MONITOR RECIPIENTS]
N OPTYPE
S OPTYPE=""
RECIP1 KILL ^TMP($J,"HLMREP")
D HD("Monitor Recipients Reports")
D EXRECIP
S OPTYPE=$$RECIPO(OPTYPE) QUIT:OPTYPE']"" ;->
D RECIPLD
D @OPTYPE
G RECIP1 ;->
;
RECIPMR ; List by monitor/recipient...
D RECIPR("M")
D BROWSE^DDBR($NA(^TMP($J,"HLMREP","REP")),"N"," Monitor Recipient ")
Q
;
RECIPRM ; List by recipient/monitor...
D RECIPR("R")
D BROWSE^DDBR($NA(^TMP($J,"HLMREP","REP")),"N"," Recipient Monitor ")
Q
;
RECIPR(SUB) ; Create displayable report...
N CT,CTIN,SUB1,SUB1L,SUB2,SUB2L,STAT,TXT
S SUB1="",CT=0,CTIN=0,SUB1L="",SUB2L=""
F S SUB1=$O(^TMP($J,"HLMREP",SUB,SUB1)) Q:SUB1']"" D
. S SUB2=""
. F S SUB2=$O(^TMP($J,"HLMREP",SUB,SUB1,SUB2)) Q:SUB2']"" D
. . S STAT=$G(^TMP($J,"HLMREP",SUB,SUB1,SUB2))
. . I STAT'="A" S CTIN=CTIN+1 ; Inactive status counter
. . S STAT=$S(STAT'="A":"* ",1:" ")
. . S TXT=$$PRT(SUB1,SUB1L,STAT)_$$PRT(SUB2,SUB2L)
. . D ADD(TXT)
. . S CT=CT+1
. . S SUB1L=SUB1,SUB2L=SUB2
Q
;
PRT(P1,P1L,ST) ; Format part of display line...
; CT -- req
N TXT
S TXT=$S($G(ST)]"":" ",1:"")_$E($S(P1'=P1L:P1,1:"")_$$REPEAT^XLFSTR("-",35),1,33)_" "
Q TXT
;
ADD(TXT) ;
N NO
S NO=$O(^TMP($J,"HLMREP","REP",":"),-1)+1
S ^TMP($J,"HLMREP","REP",+NO)=TXT
Q
;
RECIPLD ; Load monitor and recipient data...
N DATA,IEN7761,MONM,STAT
S IEN7761=0
F S IEN7761=$O(^HLEV(776.1,IEN7761)) Q:IEN7761'>0 D
. S DATA=$G(^HLEV(776.1,+IEN7761,0)) QUIT:DATA']"" ;->
. S MONM=$$UP^XLFSTR($P(DATA,U)) QUIT:DATA']"" ;->
. S STAT=$S($P(DATA,U,2)="A":"ACTIVE",1:"INACTIVE")
. D RECIPM(MONM,IEN7761,STAT,60) ; Load mail groups...
. D RECIPM(MONM,IEN7761,STAT,61) ; Load local recipients...
. D RECIPM(MONM,IEN7761,STAT,62) ; Load remotes...
Q
;
RECIPM(MONM,IEN7761,STAT,SUBDD) ; Load two globals...
N MIEN,RECIP
S MIEN=0
F S MIEN=$O(^HLEV(776.1,+IEN7761,SUBDD,MIEN)) Q:MIEN'>0 D
. S RECIP=$$UP^XLFSTR($P($G(^HLEV(776.1,+IEN7761,+SUBDD,MIEN,0)),U))
. QUIT:RECIP']"" ;->
. I SUBDD=60 D QUIT:RECIP']"" ;->
. . S RECIP=$P($G(^XMB(3.8,+RECIP,0)),U) QUIT:RECIP']"" ;->
. . S RECIP="G."_RECIP
. I SUBDD=61 D QUIT:RECIP']"" ;->
. . S RECIP=$P($G(^VA(200,+RECIP,0)),U)
. S ^TMP($J,"HLMREP","M",MONM_"[#"_IEN7761_"]",RECIP)=STAT
. S ^TMP($J,"HLMREP","R",RECIP,MONM_"[#"_IEN7761_"]")=STAT
Q
;
RECIPO(PMT) ; Mon/Recip or Recip/Mon
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)="S^1:List monitors/recipients;2:List recipients/monitors;3:Exit"
S DIR("A")="Select REPORT FORMAT"
S DIR("B")=$S(PMT="RECIPMR":"List recipients/monitors",1:"List monitors/recipients")
D ^DIR
QUIT:+Y<1!(+Y>2) "" ;->
Q $P("RECIPMR^RECIPRM",U,+Y)
;
EXRECIP N I,T F I=1:1 S T=$T(EXRECIP+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
;;This option lists the monitors and monitor recipients in two formats: sorted
;;by monitor and within monitor by recipient. And, by recipient, and withing
;;recipient by monitor.
QUIT
;
CONDMON ; Called by [HLEV REPORT CONDENSED MONITOR]
N BY,DIC,FLDS,L
D HD("Short Monitor Report")
W !
D EXCMON
S L="",DIC="^HLEV(776.1,",FLDS="[HLEV REPORT MONITOR-ONE LINE]"
S BY="[HLEV REPORT MONITOR]"
D EN1^DIP
D TELL^HLEVMST0("")
Q
;
EXCMON N I,T F I=1:1 S T=$T(EXCMON+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
;;This option displays monitor information in brief format. If you wish to see
;;more of the information for this monitor, please use the 'Expanded monitor
;;report' menu option.
QUIT
;
EXPMON ; Called by [HLEV REPORT EXPANDED MONITOR]
N BY,DIC,FLDS,L
D HD("Expanded Monitor Report")
W !
D EXPCMON
S L="",DIC="^HLEV(776.1,",FLDS="[CAPTIONED]"
S BY="[HLEV REPORT MONITOR - FF]"
D EN1^DIP
D TELL^HLEVMST0("")
Q
;
EXPCMON N I,T F I=1:1 S T=$T(EXCPMON+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
;;This option displays monitor information in expanded format. If you wish to
;;see more of the information for this monitor, please use the 'Condensed
;;monitor report' menu option.
QUIT
;
;
HD(TXT) W @IOF,$$CJ^XLFSTR(TXT,IOM)
W !,$$REPEAT^XLFSTR("=",IOM)
QUIT
;
DETAILS ; Show details of an event monitor occurence...
;
W !!,"Not implemented yet..."
W !
S X=$$BTE^HLCSMON("Press RETURN to continue... ")
;
Q
;
EOR ;HLEVREP0 - Event Monitor REPORTS ;5/16/03 14:42
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLEVREP0 4633 printed Dec 13, 2024@01:57:49 Page 2
HLEVREP0 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
+1 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
+2 ;
RECIP ; Called by [HLEV REPORT MONITOR RECIPIENTS]
+1 NEW OPTYPE
+2 SET OPTYPE=""
RECIP1 KILL ^TMP($JOB,"HLMREP")
+1 DO HD("Monitor Recipients Reports")
+2 DO EXRECIP
+3 ;->
SET OPTYPE=$$RECIPO(OPTYPE)
if OPTYPE']""
QUIT
+4 DO RECIPLD
+5 DO @OPTYPE
+6 ;->
GOTO RECIP1
+7 ;
RECIPMR ; List by monitor/recipient...
+1 DO RECIPR("M")
+2 DO BROWSE^DDBR($NAME(^TMP($JOB,"HLMREP","REP")),"N"," Monitor Recipient ")
+3 QUIT
+4 ;
RECIPRM ; List by recipient/monitor...
+1 DO RECIPR("R")
+2 DO BROWSE^DDBR($NAME(^TMP($JOB,"HLMREP","REP")),"N"," Recipient Monitor ")
+3 QUIT
+4 ;
RECIPR(SUB) ; Create displayable report...
+1 NEW CT,CTIN,SUB1,SUB1L,SUB2,SUB2L,STAT,TXT
+2 SET SUB1=""
SET CT=0
SET CTIN=0
SET SUB1L=""
SET SUB2L=""
+3 FOR
SET SUB1=$ORDER(^TMP($JOB,"HLMREP",SUB,SUB1))
if SUB1']""
QUIT
Begin DoDot:1
+4 SET SUB2=""
+5 FOR
SET SUB2=$ORDER(^TMP($JOB,"HLMREP",SUB,SUB1,SUB2))
if SUB2']""
QUIT
Begin DoDot:2
+6 SET STAT=$GET(^TMP($JOB,"HLMREP",SUB,SUB1,SUB2))
+7 ; Inactive status counter
IF STAT'="A"
SET CTIN=CTIN+1
+8 SET STAT=$SELECT(STAT'="A":"* ",1:" ")
+9 SET TXT=$$PRT(SUB1,SUB1L,STAT)_$$PRT(SUB2,SUB2L)
+10 DO ADD(TXT)
+11 SET CT=CT+1
+12 SET SUB1L=SUB1
SET SUB2L=SUB2
End DoDot:2
End DoDot:1
+13 QUIT
+14 ;
PRT(P1,P1L,ST) ; Format part of display line...
+1 ; CT -- req
+2 NEW TXT
+3 SET TXT=$SELECT($GET(ST)]"":" ",1:"")_$EXTRACT($SELECT(P1'=P1L:P1,1:"")_$$REPEAT^XLFSTR("-",35),1,33)_" "
+4 QUIT TXT
+5 ;
ADD(TXT) ;
+1 NEW NO
+2 SET NO=$ORDER(^TMP($JOB,"HLMREP","REP",":"),-1)+1
+3 SET ^TMP($JOB,"HLMREP","REP",+NO)=TXT
+4 QUIT
+5 ;
RECIPLD ; Load monitor and recipient data...
+1 NEW DATA,IEN7761,MONM,STAT
+2 SET IEN7761=0
+3 FOR
SET IEN7761=$ORDER(^HLEV(776.1,IEN7761))
if IEN7761'>0
QUIT
Begin DoDot:1
+4 ;->
SET DATA=$GET(^HLEV(776.1,+IEN7761,0))
if DATA']""
QUIT
+5 ;->
SET MONM=$$UP^XLFSTR($PIECE(DATA,U))
if DATA']""
QUIT
+6 SET STAT=$SELECT($PIECE(DATA,U,2)="A":"ACTIVE",1:"INACTIVE")
+7 ; Load mail groups...
DO RECIPM(MONM,IEN7761,STAT,60)
+8 ; Load local recipients...
DO RECIPM(MONM,IEN7761,STAT,61)
+9 ; Load remotes...
DO RECIPM(MONM,IEN7761,STAT,62)
End DoDot:1
+10 QUIT
+11 ;
RECIPM(MONM,IEN7761,STAT,SUBDD) ; Load two globals...
+1 NEW MIEN,RECIP
+2 SET MIEN=0
+3 FOR
SET MIEN=$ORDER(^HLEV(776.1,+IEN7761,SUBDD,MIEN))
if MIEN'>0
QUIT
Begin DoDot:1
+4 SET RECIP=$$UP^XLFSTR($PIECE($GET(^HLEV(776.1,+IEN7761,+SUBDD,MIEN,0)),U))
+5 ;->
if RECIP']""
QUIT
+6 ;->
IF SUBDD=60
Begin DoDot:2
+7 ;->
SET RECIP=$PIECE($GET(^XMB(3.8,+RECIP,0)),U)
if RECIP']""
QUIT
+8 SET RECIP="G."_RECIP
End DoDot:2
if RECIP']""
QUIT
+9 ;->
IF SUBDD=61
Begin DoDot:2
+10 SET RECIP=$PIECE($GET(^VA(200,+RECIP,0)),U)
End DoDot:2
if RECIP']""
QUIT
+11 SET ^TMP($JOB,"HLMREP","M",MONM_"[#"_IEN7761_"]",RECIP)=STAT
+12 SET ^TMP($JOB,"HLMREP","R",RECIP,MONM_"[#"_IEN7761_"]")=STAT
End DoDot:1
+13 QUIT
+14 ;
RECIPO(PMT) ; Mon/Recip or Recip/Mon
+1 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+2 SET DIR(0)="S^1:List monitors/recipients;2:List recipients/monitors;3:Exit"
+3 SET DIR("A")="Select REPORT FORMAT"
+4 SET DIR("B")=$SELECT(PMT="RECIPMR":"List recipients/monitors",1:"List monitors/recipients")
+5 DO ^DIR
+6 ;->
if +Y<1!(+Y>2)
QUIT ""
+7 QUIT $PIECE("RECIPMR^RECIPRM",U,+Y)
+8 ;
EXRECIP NEW I,T
FOR I=1:1
SET T=$TEXT(EXRECIP+I)
if T'[";;"
QUIT
WRITE !,$PIECE(T,";;",2,99)
+1 ;;This option lists the monitors and monitor recipients in two formats: sorted
+2 ;;by monitor and within monitor by recipient. And, by recipient, and withing
+3 ;;recipient by monitor.
+4 QUIT
+5 ;
CONDMON ; Called by [HLEV REPORT CONDENSED MONITOR]
+1 NEW BY,DIC,FLDS,L
+2 DO HD("Short Monitor Report")
+3 WRITE !
+4 DO EXCMON
+5 SET L=""
SET DIC="^HLEV(776.1,"
SET FLDS="[HLEV REPORT MONITOR-ONE LINE]"
+6 SET BY="[HLEV REPORT MONITOR]"
+7 DO EN1^DIP
+8 DO TELL^HLEVMST0("")
+9 QUIT
+10 ;
EXCMON NEW I,T
FOR I=1:1
SET T=$TEXT(EXCMON+I)
if T'[";;"
QUIT
WRITE !,$PIECE(T,";;",2,99)
+1 ;;This option displays monitor information in brief format. If you wish to see
+2 ;;more of the information for this monitor, please use the 'Expanded monitor
+3 ;;report' menu option.
+4 QUIT
+5 ;
EXPMON ; Called by [HLEV REPORT EXPANDED MONITOR]
+1 NEW BY,DIC,FLDS,L
+2 DO HD("Expanded Monitor Report")
+3 WRITE !
+4 DO EXPCMON
+5 SET L=""
SET DIC="^HLEV(776.1,"
SET FLDS="[CAPTIONED]"
+6 SET BY="[HLEV REPORT MONITOR - FF]"
+7 DO EN1^DIP
+8 DO TELL^HLEVMST0("")
+9 QUIT
+10 ;
EXPCMON NEW I,T
FOR I=1:1
SET T=$TEXT(EXCPMON+I)
if T'[";;"
QUIT
WRITE !,$PIECE(T,";;",2,99)
+1 ;;This option displays monitor information in expanded format. If you wish to
+2 ;;see more of the information for this monitor, please use the 'Condensed
+3 ;;monitor report' menu option.
+4 QUIT
+5 ;
+6 ;
HD(TXT) WRITE @IOF,$$CJ^XLFSTR(TXT,IOM)
+1 WRITE !,$$REPEAT^XLFSTR("=",IOM)
+2 QUIT
+3 ;
DETAILS ; Show details of an event monitor occurence...
+1 ;
+2 WRITE !!,"Not implemented yet..."
+3 WRITE !
+4 SET X=$$BTE^HLCSMON("Press RETURN to continue... ")
+5 ;
+6 QUIT
+7 ;
EOR ;HLEVREP0 - Event Monitor REPORTS ;5/16/03 14:42