source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAHLEX.m@ 1286

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

initial load of WorldVistAEHR

File size: 7.7 KB
Line 
1RAHLEX ;HIRMFO/REL,CRT - RAD/NUC MED HL7 Voice Reporting Exception List; 02/02/99
2 ;;5.0;Radiology/Nuclear Medicine;**12,17,25**;Mar 16, 1998
3 ; Last Edited by CRT
4 ;
5 S RAHLAPP="^TMP($J,""RAHLAPP"")" K @RAHLAPP ; Sending Apps included
6 S RAHLEX="^TMP($J,""RAHLEX"")" K @RAHLEX ; List Display
7 S RAHLSEL="^TMP($J,""RAHLSEL"")" K @RAHLSEL ; X-ref Display to ^DIZ
8 S RAHLUSR="^TMP($J,""RAHLUSR"")" K @RAHLUSR ; Rad Users included
9 S RAHLSRT="^TMP($J,""RAHLSRT"")" K @RAHLSRT ; Sorted records from #79.3
10 S VALMCNT=0
11 ;
12 W @IOF
13 ;
14 D EN^DDIOL("Rad/Nuc Med HL7 Voice Reporting Exception List","","!?5")
15 ;
16 I ('$O(^RA(79.3,0))) D G EXIT
17 .S RACLR=1
18 .W $C(7)
19 .D EN^DDIOL("No Voice Reporting Exceptions currently recorded","","!?5")
20 .D END
21 ;
22APPS ; 1st prompt for Sending Applications to print
23 ; skip prompt if there is only one Sending App.
24 ;
25 S RAHLAIEN="" F I=1:1:2 S RAHLAIEN=$O(^RA(79.3,"AA",RAHLAIEN))
26 I RAHLAIEN="" D G STDT
27 .S RAHLAIEN=$O(^RA(79.3,"AA",RAHLAIEN))
28 .S RAHLA=$$GET1^DIQ(771,RAHLAIEN,.01)
29 .S @RAHLAPP@(RAHLA,RAHLAIEN)=""
30 .K RAHLAIEN,RAHLA
31 ;
32 K RAHLAIEN
33 S RAINPUT=""
34 S RADIC="^HL(771,"
35 S RADIC(0)="ABEQSZ"
36 S RADIC("A")="Select Voice Reporting Application: "
37 S RADIC("B")="ALL"
38 S RADIC("S")="I $D(^RA(79.3,""AA"",Y))"
39 S RAUTIL="RAHLAPP"
40 D EN1^RASELCT(.RADIC,RAUTIL,"",RAINPUT)
41 K RADIC,RAUTIL,RAINPUT
42 I '$D(@RAHLAPP)!$G(RAQUIT) D G EXIT
43 .W $C(7)
44 .D EN^DDIOL("No Voice Reporting Applications selected for reporting","","!?5")
45 .D END
46 ;
47STDT ; Prompt for Start From Date
48 ;
49 D EN^DDIOL(" ","","!")
50 K %DT
51 S %DT="AEPST"
52 S %DT("A")="Exception starting date/time: "
53 S %DT(0)="-NOW" ; Must be in the past
54 D ^%DT K %DT
55 I X']"" D EN^DDIOL("You must enter a start date, or '^' to exit","","!?5") G STDT
56 S RAHL7SDT=Y
57 I $D(DTOUT)!(U[X) D END G EXIT
58 ;
59ETDT ; Prompt for End Date (Must be after Start Date.. obviously!)
60 ;
61 D EN^DDIOL(" ","","!")
62 S %DT="AEPST"
63 S %DT("A")="Exception ending date/time: "
64 S %DT(0)=RAHL7SDT
65 S %DT("B")="NOW" ; Default of current date/time
66 D ^%DT K %DT
67 I $D(DTOUT)!(U[X) D END G EXIT
68 S RAHL7EDT=Y
69 I $P(RAHL7EDT,".",2)="" S RAHL7EDT=+RAHL7EDT+1
70 ;
71USER ; Prompt for Users to include
72 ; skip prompt if there is only one User on file.
73 ; also there may be entries with no user!!
74 ;
75 S RAHLUIEN=$O(^RA(79.3,"AB","")) G:RAHLUIEN="" LISTMAN
76 S RAHLUIEN=$O(^RA(79.3,"AB",RAHLUIEN))
77 I RAHLUIEN="" D G LISTMAN
78 .S RAHLUIEN=$O(^RA(79.3,"AB",RAHLUIEN))
79 .S RAHLU=$$GET1^DIQ(200,RAHLUIEN,.01)
80 .S @RAHLUSR@(RAHLU,RAHLUIEN)=""
81 .K RAHLUIEN,RAHLU
82 ;
83 K RAHLUIEN
84 S RAINPUT=""
85 S RADIC="^VA(200,"
86 S RADIC(0)="ABEQZ"
87 S RADIC("A")="Select Radiology User: "
88 S RADIC("B")="ALL"
89 ;S RADIC("S")="I $D(^RA(79.3,""AB"",Y))"
90 S RAUTIL="RAHLUSR"
91 D EN1^RASELCT(.RADIC,RAUTIL,"",RAINPUT)
92 K RADIC,RAUTIL,RAINPUT
93 I '$D(@RAHLUSR)!$G(RAQUIT) D G EXIT
94 .W $C(7)
95 .D EN^DDIOL("No Radiology User selected for reporting","","!?5")
96 .D END
97 ;
98LISTMAN ; Call List Manager
99 D EN^VALM("RA HL7 VOICE REPORTING ERRORS")
100 Q
101 ;
102HEADER ; Report/Page Header
103 ;
104 S VALMHDR(1)=""
105 Q
106 ;
107SETTMP ;Create ^TMP workfile with sorted records on...
108 ;
109 S RAPPX="" F S RAPPX=$O(@RAHLAPP@(RAPPX)) Q:RAPPX="" D
110 .S RAPPI=0 F S RAPPI=$O(@RAHLAPP@(RAPPX,RAPPI)) Q:RAPPI'>0 D
111 ..S RAXIEN="" F S RAXIEN=$O(^RA(79.3,"AA",RAPPI,RAXIEN)) Q:RAXIEN'>0 D
112 ...S RAX=$G(^RA(79.3,RAXIEN,0)) Q:RAX=""
113 ...;
114 ...S RASEND=$$GET1^DIQ(771,RAPPI,3)
115 ...;
116 ...S RADATE=$P(RAX,U,1) Q:RADATE=""
117 ...I (RAHL7SDT]RADATE)!(RADATE]RAHL7EDT) Q
118 ...;
119 ...S RAUSER=$P(RAX,U,6)
120 ...I RAUSER'="" S RAUSER=$$GET1^DIQ(200,RAUSER,.01) Q:'$D(@RAHLUSR@(RAUSER))
121 ...S:RAUSER="" RAUSER="Not Known"
122 ...;
123 ...S RADPT=$P(RAX,U,3)
124 ...S:RADPT'="" RADPT=$$GET1^DIQ(70,RADPT,.01)
125 ...S:RADPT="" RADPT="Not known"
126 ...;
127 ...S RACN=$P(RAX,U,4)
128 ...S:RACN="" RACN="?????"
129 ...;
130 ...S RAEXCP=$$GET1^DIQ(79.3,RAXIEN,1)
131 ...;
132 ...S @RAHLSRT@(RASEND,RADATE,RADPT,RACN,RAUSER)=RAXIEN
133 ...S @RAHLSRT@(RASEND,RADATE,RADPT,RACN,RAUSER,"ERR")=RAEXCP
134 ...Q
135 K RAPPI,RAPPX,RAX,RAXIEN,RASEND,RADATE,Y,RAUSER,RADPT,RACN,RAEXCP
136 Q
137 ;
138ENTRY ; List Manager Entry Point
139 ;
140 D SETTMP^RAHLEX
141 S (HL7EX,VALMCNT)=0
142 ;
143 I '$D(@RAHLSRT) D G END
144 .W $C(7)
145 .S VALMSG="Nothing to Report for selection criteria"
146 ;
147 ;
148DISPLAY ; Create ARRAY for List Manager display on ^TMP($J,"RAHLEX")
149 ;
150 S SPACES=" "
151 S (RAOLD,RASEND)="" F S RASEND=$O(@RAHLSRT@(RASEND)) Q:RASEND="" D
152 .; Blank line
153 .S VALMCNT=VALMCNT+1,@RAHLEX@(VALMCNT,0)=""
154 .; Sending Application Sub-Heading
155 .I RAOLD'=RASEND D
156 ..S VALMCNT=VALMCNT+1
157 ..S LINE=" HL7 Voice Reporting Application: "_$E(RASEND_$$REPEAT^XLFSTR(" ",30),1,30)_" "
158 ..S @RAHLEX@(VALMCNT,0)=LINE
159 ..D CNTRL^VALM10(VALMCNT,6,33+$L(RASEND),IORVON,IORVOFF,0)
160 ..S RAOLD=RASEND
161 .;
162 .S RADATE="" F S RADATE=$O(@RAHLSRT@(RASEND,RADATE)) Q:RADATE="" D
163 ..S RADPT="" F S RADPT=$O(@RAHLSRT@(RASEND,RADATE,RADPT)) Q:RADPT="" D
164 ...S RACN="" F S RACN=$O(@RAHLSRT@(RASEND,RADATE,RADPT,RACN)) Q:RACN="" D
165 ....S RAUSER="" F S RAUSER=$O(@RAHLSRT@(RASEND,RADATE,RADPT,RACN,RAUSER)) Q:RAUSER="" D
166 .....S RAEXCP=@RAHLSRT@(RASEND,RADATE,RADPT,RACN,RAUSER,"ERR")
167 .....S VALMCNT=VALMCNT+1 S @RAHLEX@(VALMCNT,0)="" ; Blank line
168 .....S VALMCNT=VALMCNT+1,HL7EX=$G(HL7EX)+1
169 .....S @RAHLSEL@(VALMCNT)=@RAHLSRT@(RASEND,RADATE,RADPT,RACN,RAUSER)
170 .....S LINE=$E(HL7EX_"."_$E(SPACES,1,5),1,5)
171 .....D DISDATE(" ")
172 .....S LINE=LINE_$E(XRADATE_$E(SPACES,1,22),1,22)
173 .....S LINE=LINE_$E($E(RADPT,1,25)_$E(SPACES,1,27),1,27)
174 .....S LINE=LINE_$E(RACN_$E(SPACES,1,7),1,7)
175 .....S LINE=LINE_$E(RAUSER,1,19)
176 .....S @RAHLEX@(VALMCNT,0)=LINE
177 .....S VALMCNT=VALMCNT+1
178 .....S LINE=" Error: "_RAEXCP
179 .....S @RAHLEX@(VALMCNT,0)=LINE
180 ;
181END ; Tidy up variables after ENTRY call only
182 K XRADATE,RAQUIT,RASEND,RADPT,RACN,RAEXCP,RADATE,RAUSER,LINE,RAOLD,SPACES
183 ;
184 Q
185 ;
186EXIT ; Tidy variables after function (including ListMan IO* and VALM*)
187 K VALMCNT,HL7EX,HL,RAHL7SDT,RAHL7EDT,Y,X,POP,PAGE,DTOUT
188 K @RAHLEX,RAHLEX,@RAHLSRT,RAHLSRT,@RAHLSEL,RAHLSEL,TITLE,DISYS
189 K @RAHLAPP,RAHLAPP,@RAHLUSR,RAHLUSR
190 ;
191 D:'$G(RACLR) CLEAR^VALM1
192 ;
193 K VALM,VALMAR,VALMBCK,VALMBG,VALMCAP,VALMCC,VALMCNT
194 K VALMDDF,VALMDN,VALMHDR,VALMIOXY,VALMKEY,VALMLFT,VALMLST
195 K VALMMENU,VALMMSGR,VALMUP,VALMSG,RACLR
196 ;
197 K IOBOFF,IOBON,IOINORM,IOINHI,IORVON,IORVOFF,IOUOFF,IOUON
198 Q
199 ;
200DISDATE(SEP) ; Display date in external form
201 ; SEP is the separator between date and time - eg " " or "@" or " at "
202 S Y=$P(RADATE,".") D D^RAUTL
203 S XRADATE=Y_SEP_$E(RADATE_0,9,10)_":"_$E(RADATE_000,11,12)_":"_$E(RADATE_00000,13,14)
204 K Y
205 Q
206 ;
207HELP ; The '??' help ListMan Call:
208 I X="?" D Q
209 .D EN^DDIOL("Choose one of the options listed","","!?5")
210 .D EN^DDIOL("Or '??' to list More Options","","!?5")
211 .D WAIT^RAHLEX1
212 D CLEAR^VALM1
213 K RAH
214 S RAH(1)=" Rad/Nuc Med HL7 Voice Reporting Exception List"
215 S RAH(1,"F")=""
216 S RAH(2)="=============================================="
217 S RAH(3)="This utility lists all the Errors that have been reported from HL7"
218 S RAH(4)="Voice Reporting applications for Radiology/Nuclear Medicine."
219 S RAH(5)="It provides some additional facilities:"
220 S RAH(6)="1. PL - The list can be printed to screen or to a printer, prints"
221 S RAH(7)=" can be queued or printed immediately."
222 S RAH(8)="2. RS - Any rejected message listed can be re-submitted. To re-send"
223 S RAH(9)=" a message via HL7, first try to resolve the reported"
224 S RAH(10)=" problem, then return to this list and select the error. Once"
225 S RAH(11)=" successfully re-submitted the reported error will be purged."
226 S RAH(12)=" Note however, that successful re-submission does not guarantee"
227 S RAH(13)=" the problem has been resolved and that Radiology will be updated"
228 S RAH(14)="3. DE - To purge a reported error without re-submitting first."
229 S RAH(15)=""
230 F RAHI=2:1:15 S RAH(RAHI,"F")="!?5"
231 S RAH(5,"F")="!!"
232 S (RAH(3,"F"),RAH(4,"F"))="!"
233 D EN^DDIOL(.RAH)
234 S VALMBCK="R"
235 K RAHI,RAH
236 Q
Note: See TracBrowser for help on using the repository browser.