source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLEVREP0.m@ 836

Last change on this file since 836 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1HLEVREP0 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
3 ;
4RECIP ; Called by [HLEV REPORT MONITOR RECIPIENTS]
5 N OPTYPE
6 S OPTYPE=""
7RECIP1 KILL ^TMP($J,"HLMREP")
8 D HD("Monitor Recipients Reports")
9 D EXRECIP
10 S OPTYPE=$$RECIPO(OPTYPE) QUIT:OPTYPE']"" ;->
11 D RECIPLD
12 D @OPTYPE
13 G RECIP1 ;->
14 ;
15RECIPMR ; List by monitor/recipient...
16 D RECIPR("M")
17 D BROWSE^DDBR($NA(^TMP($J,"HLMREP","REP")),"N"," Monitor Recipient ")
18 Q
19 ;
20RECIPRM ; List by recipient/monitor...
21 D RECIPR("R")
22 D BROWSE^DDBR($NA(^TMP($J,"HLMREP","REP")),"N"," Recipient Monitor ")
23 Q
24 ;
25RECIPR(SUB) ; Create displayable report...
26 N CT,CTIN,SUB1,SUB1L,SUB2,SUB2L,STAT,TXT
27 S SUB1="",CT=0,CTIN=0,SUB1L="",SUB2L=""
28 F S SUB1=$O(^TMP($J,"HLMREP",SUB,SUB1)) Q:SUB1']"" D
29 . S SUB2=""
30 . F S SUB2=$O(^TMP($J,"HLMREP",SUB,SUB1,SUB2)) Q:SUB2']"" D
31 . . S STAT=$G(^TMP($J,"HLMREP",SUB,SUB1,SUB2))
32 . . I STAT'="A" S CTIN=CTIN+1 ; Inactive status counter
33 . . S STAT=$S(STAT'="A":"* ",1:" ")
34 . . S TXT=$$PRT(SUB1,SUB1L,STAT)_$$PRT(SUB2,SUB2L)
35 . . D ADD(TXT)
36 . . S CT=CT+1
37 . . S SUB1L=SUB1,SUB2L=SUB2
38 Q
39 ;
40PRT(P1,P1L,ST) ; Format part of display line...
41 ; CT -- req
42 N TXT
43 S TXT=$S($G(ST)]"":" ",1:"")_$E($S(P1'=P1L:P1,1:"")_$$REPEAT^XLFSTR("-",35),1,33)_" "
44 Q TXT
45 ;
46ADD(TXT) ;
47 N NO
48 S NO=$O(^TMP($J,"HLMREP","REP",":"),-1)+1
49 S ^TMP($J,"HLMREP","REP",+NO)=TXT
50 Q
51 ;
52RECIPLD ; Load monitor and recipient data...
53 N DATA,IEN7761,MONM,STAT
54 S IEN7761=0
55 F S IEN7761=$O(^HLEV(776.1,IEN7761)) Q:IEN7761'>0 D
56 . S DATA=$G(^HLEV(776.1,+IEN7761,0)) QUIT:DATA']"" ;->
57 . S MONM=$$UP^XLFSTR($P(DATA,U)) QUIT:DATA']"" ;->
58 . S STAT=$S($P(DATA,U,2)="A":"ACTIVE",1:"INACTIVE")
59 . D RECIPM(MONM,IEN7761,STAT,60) ; Load mail groups...
60 . D RECIPM(MONM,IEN7761,STAT,61) ; Load local recipients...
61 . D RECIPM(MONM,IEN7761,STAT,62) ; Load remotes...
62 Q
63 ;
64RECIPM(MONM,IEN7761,STAT,SUBDD) ; Load two globals...
65 N MIEN,RECIP
66 S MIEN=0
67 F S MIEN=$O(^HLEV(776.1,+IEN7761,SUBDD,MIEN)) Q:MIEN'>0 D
68 . S RECIP=$$UP^XLFSTR($P($G(^HLEV(776.1,+IEN7761,+SUBDD,MIEN,0)),U))
69 . QUIT:RECIP']"" ;->
70 . I SUBDD=60 D QUIT:RECIP']"" ;->
71 . . S RECIP=$P($G(^XMB(3.8,+RECIP,0)),U) QUIT:RECIP']"" ;->
72 . . S RECIP="G."_RECIP
73 . I SUBDD=61 D QUIT:RECIP']"" ;->
74 . . S RECIP=$P($G(^VA(200,+RECIP,0)),U)
75 . S ^TMP($J,"HLMREP","M",MONM_"[#"_IEN7761_"]",RECIP)=STAT
76 . S ^TMP($J,"HLMREP","R",RECIP,MONM_"[#"_IEN7761_"]")=STAT
77 Q
78 ;
79RECIPO(PMT) ; Mon/Recip or Recip/Mon
80 N DIR,DIRUT,DTOUT,DUOUT,X,Y
81 S DIR(0)="S^1:List monitors/recipients;2:List recipients/monitors;3:Exit"
82 S DIR("A")="Select REPORT FORMAT"
83 S DIR("B")=$S(PMT="RECIPMR":"List recipients/monitors",1:"List monitors/recipients")
84 D ^DIR
85 QUIT:+Y<1!(+Y>2) "" ;->
86 Q $P("RECIPMR^RECIPRM",U,+Y)
87 ;
88EXRECIP N I,T F I=1:1 S T=$T(EXRECIP+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
89 ;;This option lists the monitors and monitor recipients in two formats: sorted
90 ;;by monitor and within monitor by recipient. And, by recipient, and withing
91 ;;recipient by monitor.
92 QUIT
93 ;
94CONDMON ; Called by [HLEV REPORT CONDENSED MONITOR]
95 N BY,DIC,FLDS,L
96 D HD("Short Monitor Report")
97 W !
98 D EXCMON
99 S L="",DIC="^HLEV(776.1,",FLDS="[HLEV REPORT MONITOR-ONE LINE]"
100 S BY="[HLEV REPORT MONITOR]"
101 D EN1^DIP
102 D TELL^HLEVMST0("")
103 Q
104 ;
105EXCMON N I,T F I=1:1 S T=$T(EXCMON+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
106 ;;This option displays monitor information in brief format. If you wish to see
107 ;;more of the information for this monitor, please use the 'Expanded monitor
108 ;;report' menu option.
109 QUIT
110 ;
111EXPMON ; Called by [HLEV REPORT EXPANDED MONITOR]
112 N BY,DIC,FLDS,L
113 D HD("Expanded Monitor Report")
114 W !
115 D EXPCMON
116 S L="",DIC="^HLEV(776.1,",FLDS="[CAPTIONED]"
117 S BY="[HLEV REPORT MONITOR - FF]"
118 D EN1^DIP
119 D TELL^HLEVMST0("")
120 Q
121 ;
122EXPCMON N I,T F I=1:1 S T=$T(EXCPMON+I) QUIT:T'[";;" W !,$P(T,";;",2,99)
123 ;;This option displays monitor information in expanded format. If you wish to
124 ;;see more of the information for this monitor, please use the 'Condensed
125 ;;monitor report' menu option.
126 QUIT
127 ;
128 ;
129HD(TXT) W @IOF,$$CJ^XLFSTR(TXT,IOM)
130 W !,$$REPEAT^XLFSTR("=",IOM)
131 QUIT
132 ;
133DETAILS ; Show details of an event monitor occurence...
134 ;
135 W !!,"Not implemented yet..."
136 W !
137 S X=$$BTE^HLCSMON("Press RETURN to continue... ")
138 ;
139 Q
140 ;
141EOR ;HLEVREP0 - Event Monitor REPORTS ;5/16/03 14:42
Note: See TracBrowser for help on using the repository browser.