source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ0W.m@ 1704

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

revised back to 6/30/08 version

File size: 8.6 KB
Line 
1OCXOZ0W ;SLC/RJS,CLA - Order Check Scan ;DEC 27,2007 at 06:00
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5 ; ***************************************************************
6 ; ** Warning: This routine is automatically generated by the **
7 ; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine **
8 ; ** will be lost the next time the rule compiler executes. **
9 ; ***************************************************************
10 ;
11 Q
12 ;
13R56R1A ; Verify all Event/Elements of Rule #56 'RECENT BARIUM STUDY' Relation #1 'BARIUM'
14 ; Called from EL67+5^OCXOZ0H.
15 ;
16 Q:$G(OCXOERR)
17 ;
18 ; Local Extrinsic Functions
19 ; MCE67( -----------> Verify Event/Element: 'RECENT BARIUM STUDY ORDERED'
20 ;
21 Q:$G(^OCXS(860.2,56,"INACT"))
22 ;
23 I $$MCE67 D R56R1B
24 Q
25 ;
26R56R1B ; Send Order Check, Notication messages and/or Execute code for Rule #56 'RECENT BARIUM STUDY' Relation #1 'BARIUM'
27 ; Called from R56R1A+10.
28 ;
29 Q:$G(OCXOERR)
30 ;
31 ; Local Extrinsic Functions
32 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
33 ;
34 Q:$D(OCXRULE("R56R1B"))
35 ;
36 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
37 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^14^^Recent Barium study: "_$$GETDATA(DFN,"67^",70)_" ["_$$GETDATA(DFN,"67^",121)_"]" I 1
38 E S OCXCMSG="Recent Barium study: "_$$GETDATA(DFN,"67^",70)_" ["_$$GETDATA(DFN,"67^",121)_"]"
39 S OCXNMSG=""
40 ;
41 Q:$G(OCXOERR)
42 ;
43 ; Send Order Check Message
44 ;
45 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
46 Q
47 ;
48R57R1A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #1 'CLOZAPINE AND (WBC < 3.0 OR ANC < 1.5)'
49 ; Called from EL114+5^OCXOZ0H, and EL116+5^OCXOZ0H, and EL119+5^OCXOZ0H.
50 ;
51 Q:$G(OCXOERR)
52 ;
53 ; Local Extrinsic Functions
54 ; MCE114( ----------> Verify Event/Element: 'CLOZAPINE ANC < 1.5'
55 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
56 ; MCE119( ----------> Verify Event/Element: 'CLOZAPINE WBC < 3.0'
57 ;
58 Q:$G(^OCXS(860.2,57,"INACT"))
59 ;
60 I $$MCE116 D
61 .I $$MCE119 D R57R1B
62 .I $$MCE114 D R57R1B
63 Q
64 ;
65R57R1B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #1 'CLOZAPINE AND (WBC < 3.0 OR ANC < 1.5)'
66 ; Called from R57R1A+13.
67 ;
68 Q:$G(OCXOERR)
69 ;
70 ; Local Extrinsic Functions
71 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
72 ;
73 Q:$D(OCXRULE("R57R1B"))
74 ;
75 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
76 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^WBC < 3.0 and/or ANC < 1.5 - pharmacy cannot fill clozapine order. Most recent results - "_$$GETDATA(DFN,"114^116^119",130) I 1
77 E S OCXCMSG="WBC < 3.0 and/or ANC < 1.5 - pharmacy cannot fill clozapine order. Most recent results - "_$$GETDATA(DFN,"114^116^119",130)
78 S OCXNMSG=""
79 ;
80 Q:$G(OCXOERR)
81 ;
82 ; Send Order Check Message
83 ;
84 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
85 Q
86 ;
87R57R2A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #2 'CLOZAPINE AND NO WBC W/IN 7 DAYS'
88 ; Called from EL116+6^OCXOZ0H, and EL118+5^OCXOZ0H.
89 ;
90 Q:$G(OCXOERR)
91 ;
92 ; Local Extrinsic Functions
93 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
94 ; MCE118( ----------> Verify Event/Element: 'CLOZAPINE NO WBC W/IN 7 DAYS'
95 ;
96 Q:$G(^OCXS(860.2,57,"INACT"))
97 ;
98 I $$MCE116 D
99 .I $$MCE118 D R57R2B
100 Q
101 ;
102R57R2B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #2 'CLOZAPINE AND NO WBC W/IN 7 DAYS'
103 ; Called from R57R2A+12.
104 ;
105 Q:$G(OCXOERR)
106 ;
107 ; Local Extrinsic Functions
108 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
109 ;
110 Q:$D(OCXRULE("R57R2B"))
111 ;
112 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
113 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^Clozapine orders require a CBC/Diff within past 7 days. Please order CBC/Diff with WBC and ANC immediately. Most recent results - "_$$GETDATA(DFN,"116^118",130) I 1
114 E S OCXCMSG="Clozapine orders require a CBC/Diff within past 7 days. Please order CBC/Diff with WBC and ANC immediately. Most recent results - "_$$GETDATA(DFN,"116^118",130)
115 S OCXNMSG=""
116 ;
117 Q:$G(OCXOERR)
118 ;
119 ; Send Order Check Message
120 ;
121 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
122 Q
123 ;
124R57R3A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #3 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND NO ANC W/IN 7 D...'
125 ; Called from EL116+7^OCXOZ0H, and EL117+5^OCXOZ0H, and EL120+5^OCXOZ0I.
126 ;
127 Q:$G(OCXOERR)
128 ;
129 ; Local Extrinsic Functions
130 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
131 ; MCE117( ----------> Verify Event/Element: 'CLOZAPINE NO ANC W/IN 7 DAYS'
132 ; MCE120( ----------> Verify Event/Element: 'CLOZAPINE WBC >= 3.0 & < 3.5'
133 ;
134 Q:$G(^OCXS(860.2,57,"INACT"))
135 ;
136 I $$MCE116 D
137 .I $$MCE120 D
138 ..I $$MCE117 D R57R3B
139 Q
140 ;
141R57R3B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #3 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND NO ANC W/IN 7 D...'
142 ; Called from R57R3A+14.
143 ;
144 Q:$G(OCXOERR)
145 ;
146 ; Local Extrinsic Functions
147 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
148 ;
149 Q:$D(OCXRULE("R57R3B"))
150 ;
151 N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
152 I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^"_$$GETDATA(DFN,"116^117^120",145)_" Most recent results - "_$$GETDATA(DFN,"116^117^120",130) I 1
153 E S OCXCMSG=$$GETDATA(DFN,"116^117^120",145)_" Most recent results - "_$$GETDATA(DFN,"116^117^120",130)
154 S OCXNMSG=""
155 ;
156 Q:$G(OCXOERR)
157 ;
158 ; Send Order Check Message
159 ;
160 S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
161 Q
162 ;
163R57R4A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #4 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND ANC >= 1.5'
164 ; Called from EL116+8^OCXOZ0H, and EL120+6^OCXOZ0I, and EL115+5^OCXOZ0I.
165 ;
166 Q:$G(OCXOERR)
167 ;
168 ; Local Extrinsic Functions
169 ; MCE115( ----------> Verify Event/Element: 'CLOZAPINE ANC >= 1.5'
170 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
171 ; MCE120( ----------> Verify Event/Element: 'CLOZAPINE WBC >= 3.0 & < 3.5'
172 ;
173 Q:$G(^OCXS(860.2,57,"INACT"))
174 ;
175 I $$MCE116 D
176 .I $$MCE120 D
177 ..I $$MCE115 D R57R4B^OCXOZ0X
178 Q
179 ;
180GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
181 ;
182 N OCXE,VAL,PC S VAL=""
183 F PC=1:1:$L(OCXL,U) S OCXE=$P(OCXL,U,PC) I OCXE S VAL=$G(^TMP("OCXCHK",$J,DFN,OCXE,OCXDFI)) Q:$L(VAL)
184 Q VAL
185 ;
186MCE114() ; Verify Event/Element: CLOZAPINE ANC < 1.5
187 ;
188 ; OCXDF(37) -> PATIENT IEN data field
189 ;
190 N OCXRES
191 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(114,37)=OCXDF(37)
192 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),114)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),114))
193 Q 0
194 ;
195MCE115() ; Verify Event/Element: CLOZAPINE ANC >= 1.5
196 ;
197 ; OCXDF(37) -> PATIENT IEN data field
198 ;
199 N OCXRES
200 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(115,37)=OCXDF(37)
201 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),115)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),115))
202 Q 0
203 ;
204MCE116() ; Verify Event/Element: CLOZAPINE DRUG SELECTED
205 ;
206 ; OCXDF(37) -> PATIENT IEN data field
207 ;
208 N OCXRES
209 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(116,37)=OCXDF(37)
210 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),116)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),116))
211 Q 0
212 ;
213MCE117() ; Verify Event/Element: CLOZAPINE NO ANC W/IN 7 DAYS
214 ;
215 ; OCXDF(37) -> PATIENT IEN data field
216 ;
217 N OCXRES
218 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(117,37)=OCXDF(37)
219 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),117)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),117))
220 Q 0
221 ;
222MCE118() ; Verify Event/Element: CLOZAPINE NO WBC W/IN 7 DAYS
223 ;
224 ; OCXDF(37) -> PATIENT IEN data field
225 ;
226 N OCXRES
227 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(118,37)=OCXDF(37)
228 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),118)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),118))
229 Q 0
230 ;
231MCE119() ; Verify Event/Element: CLOZAPINE WBC < 3.0
232 ;
233 ; OCXDF(37) -> PATIENT IEN data field
234 ;
235 N OCXRES
236 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(119,37)=OCXDF(37)
237 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),119)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),119))
238 Q 0
239 ;
240MCE120() ; Verify Event/Element: CLOZAPINE WBC >= 3.0 & < 3.5
241 ;
242 ; OCXDF(37) -> PATIENT IEN data field
243 ;
244 N OCXRES
245 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(120,37)=OCXDF(37)
246 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),120)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),120))
247 Q 0
248 ;
249MCE67() ; Verify Event/Element: RECENT BARIUM STUDY ORDERED
250 ;
251 ; OCXDF(37) -> PATIENT IEN data field
252 ;
253 N OCXRES
254 S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(67,37)=OCXDF(37)
255 Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),67)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),67))
256 Q 0
257 ;
Note: See TracBrowser for help on using the repository browser.