source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCMCHLR4.m@ 1608

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

initial load of FOIAVistA 6/30/08 version

File size: 8.1 KB
Line 
1SCMCHLR4 ;ALB/KCL - PCMM HL7 Reject Processing - Protocols; 10-JAN-2000
2 ;;5.3;Scheduling;**210,272**;AUG 13, 1993
3 ;
4 ;This routine contains the PCMM Transmission Error processing protocols.
5 ;See EN^SCMCHLR2 for additional documentation on 'system wide' variables
6 ;used in this routine.
7 ;
8CS ; Description: Entry point for SCMC LE CHANGE STATUS protocol.
9 ;
10 ; Input:
11 ; SCEPS - Error Processing Status
12 ; 1 -> New
13 ; 2 -> Checked
14 ; 3 -> Both
15 ;
16 ; Output:
17 ; SCEPS - Error Processing Status
18 ; 1 -> New
19 ; 2 -> Checked
20 ; 3 -> Both
21 ; VALMBCK - 'R'=Refresh screen
22 ;
23 N DIR,DTOUT,DUOUT,Y
24 ;
25 ;Set screen to full scrolling region
26 D FULL^VALM1
27 ;
28 ;Ask user to select error processing status
29 S DIR(0)="SMO^1:New;2:Checked;3:Both"
30 S DIR("A")="Select Error Processing Status"
31 D ^DIR
32 ;
33 ;Process user response
34 I Y D
35 .S SCEPS=Y
36 .;rebuild error list for selected error processing status
37 .D BUILD^SCMCHLR1
38 ;
39 ;Place custom msg in msg window
40 ;S VALMSG=$$MRKMSG^SCMCHLR1
41 ;
42 ;Refresh screen when returning from action
43 S VALMBCK="R"
44 Q
45 ;
46 ;
47CD ; Description: Entry point for SCMC LE CHANGE DATE RANGE protocol.
48 ;
49 ; Input:
50 ; SCBEG - Begin date for date range
51 ; SCEND - End date for date range
52 ;
53 ; Output:
54 ; SCBEG - Begin date for date range
55 ; SCEND - End date for date range
56 ; VALMBCK - 'R'=Refresh screen
57 ;
58 N VALMB,VALMBEG,VALMEND,X,X1,X2
59 ;
60 ;Ask user for date range (default 2 wks prior to today)
61 S X1=DT,X2=-14
62 D C^%DTC
63 S VALMB=X
64 D RANGE^VALM1
65 ;
66 ;Process user response
67 I 'VALMBEG!('VALMEND)!((SCBEG=VALMBEG)&(SCEND=VALMEND)) D
68 .W !!,"Date Range was not changed."
69 .D PAUSE^VALM1
70 .S VALMBCK=""
71 E D
72 .S SCBEG=VALMBEG,SCEND=VALMEND
73 .;rebuild error list for selected date range
74 .D BUILD^SCMCHLR1
75 .;Refresh screen when returning from action
76 .S VALMBCK="R"
77 ;
78 ;Place custom msg in msg window
79 ;S VALMSG=$$MRKMSG^SCMCHLR1
80 ;
81 Q
82 ;
83 ;
84SL ; Description: Entry point for SCMC LE SORT LIST protocol.
85 ;
86 ; Input:
87 ; SCSORTBY - Sort by criteria
88 ;
89 ; Output:
90 ; SCSORTBY - Sort by criteria
91 ; VALMBCK - 'R'=Refresh screen
92 ;
93 N DIR,DTOUT,DUOUT,Y
94 ;
95 ;Sets screen to full scrolling region
96 D FULL^VALM1
97 ;
98 ;Ask user to select sort by criteria
99 S DIR(0)="SMO^N:Patient Name;D:Date Error Received;P:Provider"
100 S DIR("A")="Select Sort By"
101 D ^DIR
102 ;
103 ;Process user response
104 I "^N^D^P^"[("^"_Y_"^"),SCSORTBY'=Y D
105 .S SCSORTBY=Y
106 .;rebuild error list for selected sort criteria
107 .D BUILD^SCMCHLR1
108 ;
109 ;Place custom msg in msg window
110 ;S VALMSG=$$MRKMSG^SCMCHLR1
111 ;
112 ;Refresh screen when returning from action
113 S VALMBCK="R"
114 Q
115 ;
116 ;
117CE ; Description: Entry point for SCMC LE CHECK ERROR OFF LIST protocol.
118 ;
119 ; Input: None
120 ;
121 ; Output:
122 ; VALMSG - Custom message
123 ; VALMBCK - 'R'=Refresh screen
124 ;
125 N NODE,SCLINE,SCNUM,SCTLIEN,SCERIEN,VALMY
126 ;
127 ;Ask user to select transmission errors to check off the list
128 D EN^VALM2(XQORNOD(0))
129 D FULL^VALM1
130 ;
131 ;Process user selection
132 S SCNUM=0
133 F S SCNUM=$O(VALMY(SCNUM)) Q:'SCNUM D
134 .;invoke call to check error off list
135 .I $D(^TMP(SCARY_"IDX",$J,SCNUM)) D
136 ..S NODE=$G(^TMP(SCARY_"IDX",$J,SCNUM))
137 ..S SCLINE=+NODE,SCTLIEN=+$P(NODE,"^",2),SCERIEN=+$P(NODE,"^",3)
138 ..D CHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN)
139 ;
140 ;Place custom msg in msg window
141 ;S VALMSG=$$MRKMSG^SCMCHLR1
142 ;
143 ;Refresh screen when returning from action
144 S VALMBCK="R"
145 Q
146 ;
147 ;
148RP ; Description: Entry point for SCMC LE RETRANSMIT PATIENT protocol.
149 ;
150 ; Input: None
151 ;
152 ; Output:
153 ; VALMBCK - 'R'=Refresh screen
154 ;
155 N NODE,SCLINE,SCNUM,SCTLIEN,SCTLOG,VALMY
156 ;
157 ;Ask user to select transmission errors to retransmit patient
158 D EN^VALM2(XQORNOD(0))
159 D FULL^VALM1
160 ;
161 ;Process user selections
162 S SCNUM=0
163 F S SCNUM=$O(VALMY(SCNUM)) Q:'SCNUM D
164 .;
165 .I $D(^TMP(SCARY_"IDX",$J,SCNUM)) D
166 ..S NODE=$G(^TMP(SCARY_"IDX",$J,SCNUM))
167 ..S SCLINE=+NODE,SCTLIEN=+$P(NODE,"^",2),SCERIEN=+$P(NODE,"^",3)
168 ..;get information for PCMM HL7 Transmission Log entry and invoke code
169 ..;to set patient to 'retransmit'.
170 ..I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D SETPAT(SCARY,SCLINE,.SCTLOG)
171 ;
172 ;Place custom msg in msg window
173 ;S VALMSG=$$MRKMSG^SCMCHLR1
174 ;
175 ;Refresh screen when returning from action
176 S VALMBCK="R"
177 Q
178 ;
179 ;
180PE ; Description: Entry point for SCMC LE PRINT ERROR CODES protocol.
181 ;
182 ; Input: None
183 ;
184 ; Output:
185 ; VALMBCK - 'R'=Refresh screen
186 ;
187 ;Sets screen to full scrolling region
188 D FULL^VALM1
189 ;
190 ;Print PCMM Transmission Error Code Report
191 D ECRPRT^SCMCHLR7
192 D PAUSE^VALM1
193 ;
194 ;Place custom msg in msg window
195 ;S VALMSG=$$MRKMSG^SCMCHLR1
196 ;
197 ;Refresh screen when returning from action
198 S VALMBCK="R"
199 Q
200 ;
201 ;
202RA ; Description: Entry point for SCMC LE RETRANSMIT ALL protocol.
203 ;
204 ; Input: None
205 ;
206 ; Output:
207 ; VALMBCK - 'R'=Refresh screen
208 ;
209 N DIR,DTOUT,DUOUT,Y
210 ;
211 ;Sets screen to full scrolling region
212 D FULL^VALM1
213 ;
214 ;Ask user if they want to retransmit all patients
215 S DIR(0)="Y"
216 S DIR("A")="Mark all patients for re-transmission"
217 S DIR("A",1)="This action will allow all patients to be marked for re-transmission."
218 S DIR("A",2)="The error processing status for all patients will be marked as checked."
219 S DIR("B")="NO"
220 D ^DIR
221 ;
222 ;Process user response
223 I '$D(DIRUT) D
224 .I +Y D
225 ..;set all patients as re-transmit
226 ..D UPDALL
227 ;
228 ;Place custom msg in msg window
229 ;S VALMSG=$$MRKMSG^SCMCHLR1
230 ;
231 ;Refresh screen when returning from action
232 S VALMBCK="R"
233 Q
234 ;
235 ;
236CHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN) ;
237 ; Description: Used to check an error off the list.
238 ;
239 ; Input:
240 ; SCARY - Global array subscript
241 ; SCLINE - Line number
242 ; SCTLIEN - PCMM HL7 Transmission Log IEN
243 ; SCERIEN - IEN of recrord in Error Code (#404.47142) multiple
244 ;
245 ; Output: None
246 ;
247 N SCERMSG
248 ;
249 I $$UPDEPS^SCMCHLA(SCTLIEN,SCERIEN,2,.SCERMSG) D
250 .D FLDTEXT^VALM10(SCLINE,"STATUS","Checked")
251 .D FLDCTRL^VALM10(SCLINE,"STATUS",IOINHI,IOINORM)
252 E D
253 .W !,^TMP(SCARY,$J,SCLINE,0)
254 .W:$G(SCERMSG)'="" !,"...",$$LOWER^VALM1(SCERMSG)
255 .W !,"...Unable to check error off list"
256 .D PAUSE^VALM1
257 Q
258 ;
259 ;
260SETPAT(SCARY,SCLINE,SCTLOG) ; Description: Used to set patient to marked for re-transmit.
261 ;
262 ; Input:
263 ; SCARY - Global array subscript
264 ; SCLINE - Line number
265 ; SCTLOG - Transmission log entry array
266 ;
267 ; Output: None
268 ;
269 N SCERROR
270 ;
271 ;Set patient to marked for re-transmit
272 I $$UPDSTAT^SCMCHLA(SCTLIEN,"M",.SCERROR) D
273 .D UPDPAT(SCARY,$S($G(SCTLOG("DFN")):SCTLOG("DFN"),1:"W"),$S('$G(SCTLOG("DFN")):SCLINE,1:""))
274 E D
275 .W !,^TMP(SCARY,$J,SCLINE,0)
276 .W:$G(SCERMSG)'="" !,"...",$$LOWER^VALM1(SCERROR)
277 .W !,"...Unable to mark patient for re-transmit"
278 .D PAUSE^VALM1
279 Q
280 ;
281 ;
282UPDPAT(SCARY,SCDFN,LINE) ; Description: Update all PCMM HL7 Transmssion Log
283 ; entries in the list for the patient as 'marked for re-transmit'.
284 ;
285 ; Input:
286 ; SCARY - Global array subscript
287 ; SCDFN - Patient IEN
288 ;
289 ; Output: None
290 ;
291 N SCLINE,SCTLIEN
292 S:'$G(LINE) LINE=9999999
293 ;
294 ;Loop thru entries in the list for the patient
295 S SCLINE=0
296 I SCDFN="W",LINE'=9999999 S SCLINE=LINE-.01
297 F S SCLINE=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)) Q:(('SCLINE)!(SCLINE>LINE)) S SCTLIEN=+^(SCLINE) D
298 .;update entry as marked for re-transmit
299 .D FLDTEXT^VALM10(SCLINE,"RETRANS","*")
300 .D FLDCTRL^VALM10(SCLINE,"RETRANS",IOINHI,IOINORM)
301 .;invoke code to check error off the list
302 .D CHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN)
303 Q
304 ;
305 ;
306UPDALL ; Description: Update all PCMM HL7 Transmssion Log
307 ; entries in the list as 'marked for re-transmit'.
308 ;
309 ; Input: None
310 ; Output: None
311 ;
312 N SCLINE,SCTLIEN,SCDFN
313 ;
314 ;Loop thru entries in the list for all patients
315 S SCDFN=""
316 F S SCDFN=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN)) Q:'SCDFN D
317 .;Loop thru entries in the list for the patient
318 .S SCLINE=0
319 .F S SCLINE=$O(^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)) Q:'SCLINE D
320 ..S NODE=^TMP(SCARY_"IDX",$J,"PT",SCDFN,SCLINE)
321 ..S SCTLIEN=+NODE,SCERIEN=+$P(NODE,"^",2)
322 ..;
323 ..;get information for PCMM HL7 Transmission Log entry and invoke code
324 ..;to set patient to 'retransmit'.
325 ..I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D SETPAT(SCARY,SCLINE,.SCTLOG)
326 ..;
327 ..;update entry as marked for re-transmit
328 ..D FLDTEXT^VALM10(SCLINE,"RETRANS","*")
329 ..D FLDCTRL^VALM10(SCLINE,"RETRANS",IOINHI,IOINORM)
330 ..;invoke code to check error off the list
331 ..D CHKERR(SCARY,SCLINE,SCTLIEN,SCERIEN)
332 ;
333 Q
Note: See TracBrowser for help on using the repository browser.