source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ0D.m@ 1757

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

initial load of FOIAVistA 6/30/08 version

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