source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOZ07.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 7.6 KB
Line 
1OCXOZ07 ;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 ;
13CHK121 ; Look through the current environment for valid Event/Elements for this patient.
14 ; Called from CHK2+14^OCXOZ02.
15 ;
16 Q:$G(OCXOERR)
17 ;
18 ; Local CHK121 Variables
19 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
20 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
21 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
22 ;
23 ; Local Extrinsic Functions
24 ; FILE(DFN,101, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 FINAL IMAGING RESULT)
25 ; FILE(DFN,55, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CONSULT FINAL RESULTS)
26 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
27 ;
28 I (OCXDF(2)="GMRC"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,55,"96") Q:OCXOERR
29 I (OCXDF(2)="RA"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,101,"96") Q:OCXOERR
30 Q
31 ;
32CHK131 ; Look through the current environment for valid Event/Elements for this patient.
33 ; Called from CHK12+33^OCXOZ03.
34 ;
35 Q:$G(OCXOERR)
36 ;
37 ; Local CHK131 Variables
38 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
39 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
40 ; OCXDF(54) ---> Data Field: SITE FLAGGED ORDER (BOOLEAN)
41 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
42 ; OCXDF(146) --> Data Field: INPT/OUTPT (FREE TEXT)
43 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
44 ;
45 ; Local Extrinsic Functions
46 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
47 ; PATLOC( ----------> PATIENT LOCATION
48 ;
49 S OCXDF(54)=$$SITEORD^ORB3F1(OCXDF(34),OCXDF(146)) I $L(OCXDF(54)),(OCXDF(54)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2) D CHK136
50 Q
51 ;
52CHK136 ; Look through the current environment for valid Event/Elements for this patient.
53 ; Called from CHK131+17.
54 ;
55 Q:$G(OCXOERR)
56 ;
57 ; Local Extrinsic Functions
58 ; FILE(DFN,58, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW SITE FLAGGED ORDER)
59 ;
60 S OCXOERR=$$FILE(DFN,58,"9,96,147") Q:OCXOERR
61 Q
62 ;
63CHK144 ; Look through the current environment for valid Event/Elements for this patient.
64 ; Called from CHK47+20^OCXOZ05.
65 ;
66 Q:$G(OCXOERR)
67 ;
68 ; Local CHK144 Variables
69 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
70 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
71 ; OCXDF(55) ---> Data Field: SITE FLAGGED RESULT (BOOLEAN)
72 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
73 ; OCXDF(146) --> Data Field: INPT/OUTPT (FREE TEXT)
74 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
75 ;
76 ; Local Extrinsic Functions
77 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
78 ; PATLOC( ----------> PATIENT LOCATION
79 ;
80 S OCXDF(55)=$$SITERES^ORB3F1(OCXDF(34),OCXDF(146)) I $L(OCXDF(55)),(OCXDF(55)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2) D CHK149
81 Q
82 ;
83CHK149 ; Look through the current environment for valid Event/Elements for this patient.
84 ; Called from CHK144+17.
85 ;
86 Q:$G(OCXOERR)
87 ;
88 ; Local Extrinsic Functions
89 ; FILE(DFN,59, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL LAB RESULT)
90 ;
91 S OCXOERR=$$FILE(DFN,59,"9,96,147") Q:OCXOERR
92 Q
93 ;
94CHK151 ; Look through the current environment for valid Event/Elements for this patient.
95 ; Called from CHK1+31^OCXOZ02.
96 ;
97 Q:$G(OCXOERR)
98 ;
99 ; Local CHK151 Variables
100 ; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
101 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
102 ; OCXDF(15) ---> Data Field: RESULT STATUS (OBX) (FREE TEXT)
103 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
104 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
105 ;
106 ; Local Extrinsic Functions
107 ; FILE(DFN,60, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW OBR STAT ORDER)
108 ; LIST( ------------> IN LIST OPERATOR
109 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
110 ;
111 I $L(OCXDF(1)),$$LIST(OCXDF(1),"NW,SN"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,60,"96") Q:OCXOERR
112 I $L(OCXDF(15)),(OCXDF(15)="F"),$L(OCXDF(1)),$$LIST(OCXDF(1),"RE"),$L(OCXDF(2)),($E(OCXDF(2),1,2)="LR"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)) D CHK264^OCXOZ0B
113 Q
114 ;
115CHK157 ; Look through the current environment for valid Event/Elements for this patient.
116 ; Called from CHK1+32^OCXOZ02.
117 ;
118 Q:$G(OCXOERR)
119 ;
120 ; Local CHK157 Variables
121 ; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
122 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
123 ; OCXDF(23) ---> Data Field: REQUEST STATUS (OBR) (FREE TEXT)
124 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
125 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
126 ;
127 ; Local Extrinsic Functions
128 ; FILE(DFN,61, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW ORC STAT ORDER)
129 ; LIST( ------------> IN LIST OPERATOR
130 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
131 ;
132 I $L(OCXDF(1)),$$LIST(OCXDF(1),"NW,SN"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,61,"96") Q:OCXOERR
133 I $L(OCXDF(23)),(OCXDF(23)="F"),$L(OCXDF(1)),$$LIST(OCXDF(1),"RE"),$L(OCXDF(2)) D CHK253^OCXOZ0B
134 Q
135 ;
136CHK163 ; Look through the current environment for valid Event/Elements for this patient.
137 ; Called from CHK58+18^OCXOZ05.
138 ;
139 Q:$G(OCXOERR)
140 ;
141 ; Local CHK163 Variables
142 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
143 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
144 ; OCXDF(40) ---> Data Field: ORDER MODE (FREE TEXT)
145 ; OCXDF(43) ---> Data Field: OI NATIONAL ID (FREE TEXT)
146 ;
147 I (OCXDF(40)="ACCEPT") D CHK164^OCXOZ08
148 I (OCXDF(40)="DISPLAY") S OCXDF(2)=$P($G(OCXPSD),"|",2) I $L(OCXDF(2)),($E(OCXDF(2),1,2)="PS") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) D CHK182^OCXOZ08
149 I (OCXDF(40)="SELECT") D CHK196^OCXOZ09
150 I (OCXDF(40)="SESSION") S OCXDF(2)=$P($G(OCXPSD),"|",2) I $L(OCXDF(2)),($E(OCXDF(2),1,2)="PS") S OCXDF(43)=$P($P($G(OCXPSD),"|",3),"^",1) I $L(OCXDF(43)) D CHK227^OCXOZ0A
151 Q
152 ;
153FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
154 ;
155 N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
156 S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
157 ;
158 Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
159 ;
160 S OCXDATA(DFN,OCXELE)=1
161 F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
162 .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
163 ;
164 M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
165 ;
166 Q 0
167 ;
168LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
169 ;
170 S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
171 Q (LIST[DATA)
172 ;
173ORDITEM(OIEN) ; Compiler Function: GET ORDERABLE ITEM FROM ORDER NUMBER
174 Q:'$G(OIEN) ""
175 ;
176 N OITXT,X S OITXT=$$OI^ORQOR2(OIEN) Q:'OITXT "No orderable item found."
177 S X=$G(^ORD(101.43,+OITXT,0)) Q:'$L(X) "No orderable item found."
178 Q $P(X,U,1)
179 ;
180PATLOC(DFN) ; Compiler Function: PATIENT LOCATION
181 ;
182 N OCXP1,OCXP2
183 S OCXP1=$G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",2))
184 S OCXP2=$P($G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",3)),"^",1)
185 I OCXP2 D
186 .S OCXP2=$P($G(^SC(+OCXP2,0)),"^",1,2)
187 .I $L($P(OCXP2,"^",2)) S OCXP2=$P(OCXP2,"^",2)
188 .E S OCXP2=$P(OCXP2,"^",1)
189 .S:'$L(OCXP2) OCXP2="NO LOC"
190 I $L(OCXP1),$L(OCXP2) Q OCXP1_"^"_OCXP2
191 ;
192 S OCXP2=$G(^DPT(+$G(DFN),.1))
193 I $L(OCXP2) Q "I^"_OCXP2
194 Q "O^OUTPT"
195 ;
Note: See TracBrowser for help on using the repository browser.