source: FOIAVistA/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLEVREP3.m@ 1582

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

initial load of FOIAVistA 6/30/08 version

File size: 6.1 KB
Line 
1HLEVREP3 ;O-OIFO/LJA - Event Monitor REPORTS ;02/04/2004 14:42
2 ;;1.6;HEALTH LEVEL SEVEN;**109**;Oct 13, 1995
3 ;
4REMREQO ; Remote Requestable printout - [HLEV REMOTE REQUESTABLE LIST]
5 N BY,DIC,DIOEND,FLDS,HLEVRRQ
6 W @IOF,$$CJ^XLFSTR("Remote Requestable Monitors Report",IOM)
7 W !,$$REPEAT^XLFSTR("=",IOM)
8 W !,"Some monitors may be activated by remote server request. This option sorts"
9 W !,"all monitors by whether they are ""remote requestable""."
10 W !
11 S L="",DIC=776.1,BY="[HLEV REPORT MONITOR]",DIOEND="D RRQSUMM^HLEVREP3"
12 S FLDS="[HLEV REMOTE REQUESTABLE]"
13 D EN1^DIP
14 Q
15 ;
16RRQSUMM ; Remote request summary...
17 QUIT:'$D(HLEVRRQ("[NO]")) ;->
18 W !,"Fields having [NO] in the remote requestable field are not answered YES or"
19 W !,"NO. But, since the default action is NO, these blank fields are actually"
20 W !,"an implied NO (no remote requesting allowed.)"
21 I '$D(ZTQUEUED) D TELL^HLEVMST0("","0^0^0")
22 Q
23 ;
24REMREQ() ; Called by [HLEV REMOTE REQUESTABLE] print template
25 ; Return whether entry is remote requestable
26 ; HLEVRRQ newed at top of print template run...
27 S HLEVRRQ=$S(X=1:"YES",X=0:"NO",1:"[NO]")
28 S HLEVRRQ(HLEVRRQ)=$G(HLEVRRQ(HLEVRRQ))+1
29 Q HLEVRRQ
30 ;
31MONLOAD(HLEVIENJ) ; Load data into ^TMP...
32 N DATA,EXPL,LEN,MIEN,NO,PAGE,REF,SUB,SUM,SUMX,SUMY,TITLE,VAR
33 ;
34 KILL ^TMP($J,"HLMON",+HLEVIENJ)
35 ;
36 ; Zero node
37 S DATA=$G(^HLEV(776,+$G(HLEVIENJ),0)) QUIT:DATA']"" ;->
38 D SET("START","Start",$$SDT^HLEVX001($P(DATA,U)))
39 D SET("DONE","Finish",$$SDT^HLEVX001($P(DATA,U,2)))
40 D SET("MONM","Monitor",$P($G(^HLEV(776.1,+$P(DATA,U,3),0)),U))
41 D SET("STATR","Status",$$STAT776($P(DATA,U,4)))
42 D SET("STATA","Appl",$P(DATA,U,5))
43 D SET("TIME","T-Stamp",$$SDT^HLEVX001($P(DATA,U,6)))
44 D SET("MAIL","Mail",$P(DATA,U,7))
45 D SET("ZTSK","Task",$P(DATA,U,8))
46 D SET("MST","Master",$P(DATA,U,9))
47 ;
48 ; Run Diary and Message Text...
49 F SUB=50,51 D
50 . S TITLE=$S(SUB=50:"RUN",1:"MSG")
51 . S MIEN=0
52 . F S MIEN=$O(^HLEV(776,+HLEVIENJ,SUB,MIEN)) Q:MIEN'>0 D
53 . . S NO=$O(^TMP($J,"HLMON",+HLEVIENJ,TITLE,":"),-1)+1
54 . . S ^TMP($J,"HLMON",+HLEVIENJ,TITLE,+NO)=^HLEV(776,+HLEVIENJ,SUB,MIEN,0)
55 ;
56 ; Variables...
57 S MIEN=0,SUMX="",SUMY=""
58 F S MIEN=$O(^HLEV(776,+HLEVIENJ,52,MIEN)) Q:MIEN'>0 D
59 . S REF=$G(^HLEV(776,+HLEVIENJ,52,+MIEN,0)) QUIT:$P(REF,U)']"" ;->
60 . S VAR=$P(REF,U),EXPL=$P(REF,U,2),EXPL=$S(EXPL]"":EXPL,1:REF)
61 . S DATA=$G(^HLEV(776,+HLEVIENJ,52,+MIEN,52))
62 . S ^TMP($J,"HLMON",+HLEVIENJ,"VD",VAR,EXPL)=DATA
63 .
64 . S LEN=$L(DATA) ; Length of data
65 . S LEN(1)=$L(EXPL) ; Length column header
66 . S LEN(2)=$S(LEN>LEN(1):LEN,1:LEN(1))+2 ; Largest length-data or header
67 . S LEN(3)=LEN+LEN(1)+3 ; Length - data + header
68 .
69 . S ^TMP($J,"HLMON",+HLEVIENJ,"VX",LEN(2),VAR,EXPL)=""
70 . S ^TMP($J,"HLMON",+HLEVIENJ,"VY",+LEN(3),VAR,EXPL)=""
71 .
72 . S $P(SUMX,U)=$P(SUMX,U)+1 ; # variables...
73 . S $P(SUMX,U,2)=$P(SUMX,U,2)+LEN(2)+2 ; Total columns required...
74 . I $P(SUMX,U,3)<(LEN(2)+1) S $P(SUMX,U,3)=LEN(2) ; Largest column
75 .
76 . S $P(SUMY,U)=$P(SUMY,U)+1
77 . S $P(SUMY,U,2)=$P(SUMY,U,2)+1
78 . I $P(SUMY,U,3)<(LEN(3)+1) S $P(SUMY,U,3)=LEN(3)
79 ;
80 ; # Var header, Line and Var data "pages"...
81 S LEN=0,PAGE=0,SUM=0
82 F S LEN=$O(^TMP($J,"HLMON",+HLEVIENJ,"VX",LEN)) Q:LEN'>0 D
83 . S:PAGE=0 PAGE=1
84 . I (SUM+LEN)>80 D
85 . . S PAGE=PAGE+1,SUM=0
86 . S SUM=SUM+LEN
87 S:PAGE $P(SUMX,U,4)=PAGE
88 ;
89 I SUMX]"" S ^TMP($J,"HLMON",+HLEVIENJ,"VX")=SUMX
90 I SUMY]"" S ^TMP($J,"HLMON",+HLEVIENJ,"VY")=SUMY
91 ;
92 Q
93 ;
94 ;
95SET(STORE,TAG,VAL) ; Store value to be displayed...
96 S ^TMP($J,"HLMON",HLEVIENJ,STORE)=$S(VAL]"":1,1:"")_U_TAG_U_VAL
97 Q
98 ;
99STAT776(STAT) ; Return status for use on report...
100 QUIT STAT_U_$S(STAT="E":"Error",STAT="F":"Finish",STAT="Q":"Que'd",STAT="R":"Running",1:"")
101 ;
102CTRLMON ; Re/ask for monitor to display...
103 N IEN776,IENDATE,IENONE,IOINHI,IOINORM,LASTONE,WORK,X
104 S X="IOINHI;IOINORM" D ENDR^%ZISS
105 S WORK=0
106 W !
107 S IEN776=$$ASKMON QUIT:IEN776'>0 ;->
108 S WORK=1
109 S IENDATE=$$ASKDATE(IEN776) QUIT:IENDATE'>0 ;->
110CTRLMON1 ; Reask entry point...
111 S IENONE=$$ASKONE(IEN776,IENDATE) I IENONE'>0 D QUIT ;->
112 . W !!!!,IOINHI,"Returning to display of daily map views...",IOINORM
113 . W !!
114 D SHOW^HLEVREP2(+IENONE)
115 I $P(IENONE,U,2)>1 D G CTRLMON1 ;->
116 . D TELL^HLEVMST0("","0^0^999","Press RETURN to continue... ")
117 G CTRLMON ;->
118 ;
119ASKMON() ; Ask user for a monitor to show...
120 N DIC,X,Y
121 S DIC=776.1,DIC(0)="AEMQ",DIC("A")="Select monitor to view, or RETURN to continue: "
122 S DIC("S")="I $D(^TMP($J,""HLMAP"",""E"",+Y))"
123 D ^DIC
124 Q $S(+Y>0:+Y,1:"")
125 ;
126ASKDATE(IEN776) ;
127 ; DATESEL -- req
128 N DATE,DIR,DIRUT,DTOUT,DUOUT,X,Y
129 S DIR(0)="DA",DIR("A")="Select monitor RUN DATE: "
130 S X=$$FMTE^XLFDT($O(^TMP($J,"HLMAP","E",+IEN776,DATESEL-.000001))) I X]"" S DIR("B")=X
131ASKDATE1 ;
132 S DIR("?")="Enter one of the ""run dates"" for this monitor. (Enter ?? to see list of run dates.)"
133 S DIR("??")="^D ASKDHELP^HLEVREP1"
134 D ^DIR
135 QUIT:$D(DIRUT)!($D(DTOUT))!($D(DUOUT)) "" ;->
136 QUIT:$D(^TMP($J,"HLMAP","E",+IEN776,+Y)) +Y ;->
137 D ASKDHELP
138 G ASKDATE1 ;->
139 ;
140ASKDHELP ; Help for $$ASKDATE...
141 W !!,"You must enter one of the following dates. Data exists for... "
142 W !!
143 S DATE=0
144 F S DATE=$O(^TMP($J,"HLMAP","E",IEN776,DATE)) Q:DATE'>0 D
145 . S DATE(1)=$$FMTE^XLFDT(DATE)
146 . W:$X>70 !
147 . W $J(DATE(1),15)
148 W !
149 Q
150 ;
151ASKONE(IEN776,IENDATE) ;
152 ; Defines and returns LASTONE...
153 N DATA,DATE,DIR,DIRUT,DTOUT,DUOUT,HOLD,IEN,LAST,NEXT,NO,STAT,X,Y
154 ;
155 ; Find entries and build DIR string...
156 S NO=0,IEN=0,DIR(0)="SO^"
157 F S IEN=$O(^TMP($J,"HLMAP","E",+IEN776,+IENDATE,IEN)) Q:'IEN D
158 . S DATA=$G(^HLEV(776,+IEN,0)) QUIT:DATA']"" ;->
159 . S NO=NO+1
160 . S DATE=$P(DATA,U),STAT=$$STAT776^HLEVREP3($P(DATA,U,4))
161 . S HOLD(NO)=IEN_U_DATE
162 . S DATE(DATE)=IEN_U_STAT
163 . S DIR(0)=DIR(0)_$S(DIR(0)'="SO^":";",1:"")_NO_":"_$TR($$FMTE^XLFDT(DATE),":",".")_" ["_$P(STAT,U,2)_"]"
164 QUIT:NO'>0 "" ;->
165 QUIT:NO=1 +HOLD(1)_U_1 ;->
166 ;
167 W !!,"This monitor was run more than once on the date you selected. Please select"
168 W !,"specific run time now..."
169 S NEXT=$S($G(LASTONE)'>0:1,1:LASTONE+1),NEXT=$S($D(HOLD(NEXT)):NEXT,1:"")
170 S DIR("A")="Select RUN TIME"
171 I NEXT S DIR("B")=NEXT
172 D ^DIR
173 ;
174 QUIT:'$D(HOLD(+$G(X))) "" ;-> User answered by entering number...
175 ;
176 S LASTONE=+X ; Used for DIR("B") later...
177 ;
178 Q +HOLD(+X)_U_NO
179 ;
180EOR ;HLEVREP3 - Event Monitor REPORTS ;5/16/03 14:42
Note: See TracBrowser for help on using the repository browser.