1 | OCXOZ0D ;SLC/RJS,CLA - Order Check Scan ;NOV 8,2009 at 18:44
|
---|
2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221,243**;Dec 17,1997;Build 242
|
---|
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 | ;
|
---|
13 | CHK360 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
14 | ; Called from CHK198+9^OCXOZ09.
|
---|
15 | ;
|
---|
16 | Q:$G(OCXOERR)
|
---|
17 | ;
|
---|
18 | ; Local CHK360 Variables
|
---|
19 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
20 | ; OCXDF(43) ---> Data Field: OI NATIONAL ID (FREE TEXT)
|
---|
21 | ; OCXDF(74) ---> Data Field: VA DRUG CLASS (FREE TEXT)
|
---|
22 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
23 | ; OCXDF(132) --> Data Field: CLOZAPINE MED (BOOLEAN)
|
---|
24 | ;
|
---|
25 | ; Local Extrinsic Functions
|
---|
26 | ;
|
---|
27 | S OCXDF(131)=$P($P($G(OCXPSD),"|",3),"^",4) I $L(OCXDF(131)) S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(132)=$P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",1) D CHK365
|
---|
28 | S OCXDF(43)=$P($P($G(OCXPSD),"|",3),"^",1) I $L(OCXDF(43)) S OCXDF(74)=$P($$ENVAC^PSJORUT2(OCXDF(43)),"^",2) I $L(OCXDF(74)) D CHK497^OCXOZ0G
|
---|
29 | Q
|
---|
30 | ;
|
---|
31 | CHK365 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
32 | ; Called from CHK360+14.
|
---|
33 | ;
|
---|
34 | Q:$G(OCXOERR)
|
---|
35 | ;
|
---|
36 | ; Local CHK365 Variables
|
---|
37 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
38 | ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
|
---|
39 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
40 | ; OCXDF(132) --> Data Field: CLOZAPINE MED (BOOLEAN)
|
---|
41 | ;
|
---|
42 | ; Local Extrinsic Functions
|
---|
43 | ; FILE(DFN,116, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE DRUG SELECTED)
|
---|
44 | ;
|
---|
45 | I $L(OCXDF(132)),(OCXDF(132)) S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,116,"130") Q:OCXOERR
|
---|
46 | Q
|
---|
47 | ;
|
---|
48 | CHK371 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
49 | ; Called from CHK347+16^OCXOZ0C.
|
---|
50 | ;
|
---|
51 | Q:$G(OCXOERR)
|
---|
52 | ;
|
---|
53 | ; Local CHK371 Variables
|
---|
54 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
55 | ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
|
---|
56 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
57 | ;
|
---|
58 | ; Local Extrinsic Functions
|
---|
59 | ; FILE(DFN,117, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE NO ANC W/IN 7 DAYS)
|
---|
60 | ;
|
---|
61 | S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,117,"130") Q:OCXOERR
|
---|
62 | Q
|
---|
63 | ;
|
---|
64 | CHK375 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
65 | ; Called from CHK347+17^OCXOZ0C.
|
---|
66 | ;
|
---|
67 | Q:$G(OCXOERR)
|
---|
68 | ;
|
---|
69 | ; Local CHK375 Variables
|
---|
70 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
71 | ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
|
---|
72 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
73 | ;
|
---|
74 | ; Local Extrinsic Functions
|
---|
75 | ; FILE(DFN,118, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE NO WBC W/IN 7 DAYS)
|
---|
76 | ;
|
---|
77 | S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,118,"130") Q:OCXOERR
|
---|
78 | Q
|
---|
79 | ;
|
---|
80 | CHK378 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
81 | ; Called from CHK347+18^OCXOZ0C.
|
---|
82 | ;
|
---|
83 | Q:$G(OCXOERR)
|
---|
84 | ;
|
---|
85 | ; Local CHK378 Variables
|
---|
86 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
87 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
88 | ; OCXDF(139) --> Data Field: CLOZAPINE WBC W/IN 7 FLAG (BOOLEAN)
|
---|
89 | ; OCXDF(140) --> Data Field: CLOZAPINE WBC W/IN 7 RESULT (NUMERIC)
|
---|
90 | ;
|
---|
91 | ; Local Extrinsic Functions
|
---|
92 | ;
|
---|
93 | I (OCXDF(140)<"3.0") S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),(OCXDF(139)) D CHK382
|
---|
94 | I (OCXDF(140)>2.999),(OCXDF(140)<3.5) S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),(OCXDF(139)) D CHK388
|
---|
95 | I (OCXDF(140)>3.499) S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),(OCXDF(139)) D CHK393
|
---|
96 | Q
|
---|
97 | ;
|
---|
98 | CHK382 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
99 | ; Called from CHK378+13.
|
---|
100 | ;
|
---|
101 | Q:$G(OCXOERR)
|
---|
102 | ;
|
---|
103 | ; Local CHK382 Variables
|
---|
104 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
105 | ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
|
---|
106 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
107 | ;
|
---|
108 | ; Local Extrinsic Functions
|
---|
109 | ; FILE(DFN,119, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE WBC < 3.0)
|
---|
110 | ;
|
---|
111 | S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,119,"130") Q:OCXOERR
|
---|
112 | Q
|
---|
113 | ;
|
---|
114 | CHK388 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
115 | ; Called from CHK378+14.
|
---|
116 | ;
|
---|
117 | Q:$G(OCXOERR)
|
---|
118 | ;
|
---|
119 | ; Local CHK388 Variables
|
---|
120 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
121 | ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
|
---|
122 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
123 | ;
|
---|
124 | ; Local Extrinsic Functions
|
---|
125 | ; FILE(DFN,120, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE WBC >= 3.0 & < 3.5)
|
---|
126 | ;
|
---|
127 | S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,120,"130") Q:OCXOERR
|
---|
128 | Q
|
---|
129 | ;
|
---|
130 | CHK393 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
131 | ; Called from CHK378+15.
|
---|
132 | ;
|
---|
133 | Q:$G(OCXOERR)
|
---|
134 | ;
|
---|
135 | ; Local CHK393 Variables
|
---|
136 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
137 | ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
|
---|
138 | ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
|
---|
139 | ;
|
---|
140 | ; Local Extrinsic Functions
|
---|
141 | ; FILE(DFN,121, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE WBC >= 3.5)
|
---|
142 | ;
|
---|
143 | S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,121,"130") Q:OCXOERR
|
---|
144 | Q
|
---|
145 | ;
|
---|
146 | CHK398 ; Look through the current environment for valid Event/Elements for this patient.
|
---|
147 | ; Called from CHK58+21^OCXOZ05.
|
---|
148 | ;
|
---|
149 | Q:$G(OCXOERR)
|
---|
150 | ;
|
---|
151 | ; Local CHK398 Variables
|
---|
152 | ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
|
---|
153 | ; OCXDF(62) ---> Data Field: PATIENT AGE (NUMERIC)
|
---|
154 | ; OCXDF(141) --> Data Field: AMITRIPTYLINE TEXT (FREE TEXT)
|
---|
155 | ; OCXDF(143) --> Data Field: DANGEROUS MEDS FOR PT > 64 NAME (FREE TEXT)
|
---|
156 | ;
|
---|
157 | ; Local Extrinsic Functions
|
---|
158 | ; MSGTEXT( ---------> MESSAGE TEXT
|
---|
159 | ;
|
---|
160 | I (OCXDF(143)["AMITRIPTYLINE") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(62)=$$AGE^ORQPTQ4(OCXDF(37)),OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE") D CHK403^OCXOZ0E
|
---|
161 | I (OCXDF(143)["CHLORPROPAMIDE") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(62)=$$AGE^ORQPTQ4(OCXDF(37)),OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE") D CHK410^OCXOZ0E
|
---|
162 | I (OCXDF(143)["DIPYRIDAMOLE") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(62)=$$AGE^ORQPTQ4(OCXDF(37)),OCXDF(141)=$$MSGTEXT("AMITRIPTYLINE") D CHK417^OCXOZ0E
|
---|
163 | Q
|
---|
164 | ;
|
---|
165 | FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
|
---|
166 | ;
|
---|
167 | N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
|
---|
168 | S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
|
---|
169 | ;
|
---|
170 | Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
|
---|
171 | ;
|
---|
172 | S OCXDATA(DFN,OCXELE)=1
|
---|
173 | F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
|
---|
174 | .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
|
---|
175 | ;
|
---|
176 | M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
|
---|
177 | ;
|
---|
178 | Q 0
|
---|
179 | ;
|
---|
180 | MSGTEXT(ID) ; Compiler Function: MESSAGE TEXT
|
---|
181 | ;
|
---|
182 | N MSG
|
---|
183 | S MSG=""
|
---|
184 | ;
|
---|
185 | I ID="AMITRIPTYLINE" D
|
---|
186 | .S MSG="Amitriptyline can cause cognitive impairment and loss of"
|
---|
187 | .S MSG=MSG_" balance in older patients. Consider other antidepressant"
|
---|
188 | .S MSG=MSG_" medications on formulary."
|
---|
189 | ;
|
---|
190 | I ID="CHLORPROPAMIDE" D
|
---|
191 | .S MSG="Older patients may experience hypoglycemia with"
|
---|
192 | .S MSG=MSG_" Chlorpropamide due to its long duration and variable"
|
---|
193 | .S MSG=MSG_" renal secretion. They may also be at increased risk for"
|
---|
194 | .S MSG=MSG_" Chlorpropamide-induced SIADH."
|
---|
195 | ;
|
---|
196 | I ID="DIPYRIDAMOLE" D
|
---|
197 | .S MSG="Older patients can experience adverse reactions at high doses"
|
---|
198 | .S MSG=MSG_" of Dipyridamole (e.g., headache, dizziness, syncope, GI"
|
---|
199 | .S MSG=MSG_" intolerance.) There is also questionable efficacy at"
|
---|
200 | .S MSG=MSG_" lower doses."
|
---|
201 | ;
|
---|
202 | I ID="CLOZWBC30_35" D
|
---|
203 | .S MSG="WBC between 3.0 and 3.5 with no ANC - pharmacy cannot fill"
|
---|
204 | .S MSG=MSG_" clozapine order. Please order CBC/Diff with WBC and ANC"
|
---|
205 | .S MSG=MSG_" immediately."
|
---|
206 | ;
|
---|
207 | Q MSG
|
---|
208 | ;
|
---|