source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORY14404.m@ 1766

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

initial load of WorldVistAEHR

File size: 7.1 KB
Line 
1ORY14404 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*144) ;JUN 12,2002 at 12:20
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**144**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5S ;
6 ;
7 D DOT^ORY144ES
8 ;
9 ;
10 K REMOTE,LOCAL,OPCODE,REF
11 F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
12 .S ^TMP("OCXRULE",$J,$O(^TMP("OCXRULE",$J,"A"),-1)+1)=TEXT
13 ;
14 G ^ORY14405
15 ;
16 Q
17 ;
18DATA ;
19 ;
20 ;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
21 ;;R^"860.8:",100,19
22 ;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
23 ;;R^"860.8:",100,20
24 ;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
25 ;;R^"860.8:",100,21
26 ;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
27 ;;R^"860.8:",100,22
28 ;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
29 ;;R^"860.8:",100,23
30 ;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
31 ;;R^"860.8:",100,24
32 ;;D^ ; ;
33 ;;EOR^
34 ;;KEY^860.8:^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
35 ;;R^"860.8:",.01,"E"
36 ;;D^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
37 ;;R^"860.8:",.02,"E"
38 ;;D^CRCL
39 ;;R^"860.8:",100,1
40 ;;D^ ;CRCL(DFN) ;
41 ;;R^"860.8:",100,2
42 ;;D^ ; ;
43 ;;R^"860.8:",100,3
44 ;;D^ ; N WT,AGE,SEX,SCR,SCRD,CRCL,UNAV,OCXTL,OCXTLS,OCXT,OCXTS,PSCR
45 ;;R^"860.8:",100,4
46 ;;D^ ; S UNAV="0^<Unavailable>"
47 ;;R^"860.8:",100,5
48 ;;D^ ; S PSCR="^^^^^^0"
49 ;;R^"860.8:",100,6
50 ;;D^ ; S WT=$P($$WT^ORQPTQ4(DFN),U,2)*.454 Q:'WT UNAV
51 ;;R^"860.8:",100,7
52 ;;D^ ; S AGE=$$AGE^ORQPTQ4(DFN) Q:'AGE UNAV
53 ;;R^"860.8:",100,8
54 ;;D^ ; S SEX=$P($$SEX^ORQPTQ4(DFN),U,1) Q:'$L(SEX) UNAV
55 ;;R^"860.8:",100,9
56 ;;D^ ; S OCXTL="" Q:'$$TERMLKUP("SERUM CREATININE",.OCXTL) UNAV
57 ;;R^"860.8:",100,10
58 ;;D^ ; S OCXTLS="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXTLS) UNAV
59 ;;R^"860.8:",100,11
60 ;;D^ ; S SCR="",OCXT=0 F S OCXT=$O(OCXTL(OCXT)) Q:'OCXT D
61 ;;R^"860.8:",100,12
62 ;;D^ ; .S OCXTS=0 F S OCXTS=$O(OCXTLS(OCXTS)) Q:'OCXTS D
63 ;;R^"860.8:",100,13
64 ;;D^ ; ..S SCR=$$LOCL^ORQQLR1(DFN,OCXT,OCXTS)
65 ;;R^"860.8:",100,14
66 ;;D^ ; ..I $P(SCR,U,7)>$P(PSCR,U,7) S PSCR=SCR
67 ;;R^"860.8:",100,15
68 ;;D^ ; S SCR=PSCR,SCRV=$P(SCR,U,3) Q:+$G(SCRV)<.01 UNAV
69 ;;R^"860.8:",100,16
70 ;;D^ ; S SCRD=$P(SCR,U,7) Q:'$L(SCRD) UNAV
71 ;;R^"860.8:",100,17
72 ;;D^ ; ;
73 ;;R^"860.8:",100,18
74 ;;D^ ; S CRCL=(((140-AGE)*WT)/(SCRV*72))
75 ;;R^"860.8:",100,19
76 ;;D^ ; ;
77 ;;R^"860.8:",100,20
78 ;;D^ ; I (SEX="M") Q SCRD_U_$J(CRCL,1,2)
79 ;;R^"860.8:",100,21
80 ;;D^ ; I (SEX="F") Q SCRD_U_$J((CRCL*.85),1,2)
81 ;;R^"860.8:",100,22
82 ;;D^ ; Q UNAV
83 ;;R^"860.8:",100,23
84 ;;D^ ; ;
85 ;;EOR^
86 ;;KEY^860.8:^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
87 ;;R^"860.8:",.01,"E"
88 ;;D^DETERMINE IF RENAL LAB RESULTS ARE ABNORMAL HIGH OR LOW
89 ;;R^"860.8:",.02,"E"
90 ;;D^ABREN
91 ;;R^"860.8:",100,1
92 ;;D^ ;ABREN(DFN) ;
93 ;;R^"860.8:",100,2
94 ;;D^ ; ;
95 ;;R^"860.8:",100,3
96 ;;D^ ; N OCXFLAG,OCXVAL,OCXLIST,OCXTEST,UNAV,OCXTLIST,OCXTERM,OCXSLIST,OCXSPEC
97 ;;R^"860.8:",100,4
98 ;;D^ ; S (OCXLIST,OCXTLIST)="",UNAV="0^<Unavailable>"
99 ;;R^"860.8:",100,5
100 ;;D^ ; S OCXSLIST="" Q:'$$TERMLKUP("SERUM SPECIMEN",.OCXSLIST) UNAV
101 ;;R^"860.8:",100,6
102 ;;D^ ; F OCXTERM="SERUM CREATININE","SERUM UREA NITROGEN" D Q:($L(OCXLIST)>130)
103 ;;R^"860.8:",100,7
104 ;;D^ ; .Q:'$$TERMLKUP(OCXTERM,.OCXTLIST)
105 ;;R^"860.8:",100,8
106 ;;D^ ; .S OCXTEST=0 F S OCXTEST=$O(OCXTLIST(OCXTEST)) Q:'OCXTEST D Q:($L(OCXLIST)>130)
107 ;;R^"860.8:",100,9
108 ;;D^ ; ..S OCXSPEC=0 F S OCXSPEC=$O(OCXSLIST(OCXSPEC)) Q:'OCXSPEC D Q:($L(OCXLIST)>130)
109 ;;R^"860.8:",100,10
110 ;;D^ ; ...S OCXVAL=$$LOCL^ORQQLR1(DFN,OCXTEST,OCXSPEC),OCXFLAG=$P(OCXVAL,U,5)
111 ;;R^"860.8:",100,11
112 ;;D^ ; ...I $L(OCXVAL),((OCXFLAG["H")!(OCXFLAG["L")) D
113 ;;R^"860.8:",100,12
114 ;;D^ ; ....N OCXY S OCXY=""
115 ;;R^"860.8:",100,13
116 ;;D^ ; ....S OCXY=$P(OCXVAL,U,2)_": "_$P(OCXVAL,U,3)_" "_$P(OCXVAL,U,4)
117 ;;R^"860.8:",100,14
118 ;;D^ ; ....S OCXY=OCXY_" "_$S($L(OCXFLAG):"["_OCXFLAG_"]",1:"")
119 ;;R^"860.8:",100,15
120 ;;D^ ; ....S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXVAL,U,7),"2P")
121 ;;R^"860.8:",100,16
122 ;;D^ ; ....S:$L(OCXLIST) OCXLIST=OCXLIST_" " S OCXLIST=OCXLIST_OCXY
123 ;;R^"860.8:",100,17
124 ;;D^ ; Q:'$L(OCXLIST) UNAV Q 1_U_OCXLIST
125 ;;R^"860.8:",100,18
126 ;;D^ ; ;
127 ;;EOR^
128 ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
129 ;;R^"860.8:",.01,"E"
130 ;;D^ELAPSED ORDER CHECK TIME LOGGER
131 ;;R^"860.8:",.02,"E"
132 ;;D^TIMELOG
133 ;;R^"860.8:",100,1
134 ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
135 ;;R^"860.8:",100,2
136 ;;D^ ; ;
137 ;;R^"860.8:",100,3
138 ;;D^ ; ;
139 ;;R^"860.8:",100,4
140 ;;D^ ; Q 0
141 ;;R^"860.8:",100,5
142 ;;D^ ; ;
143 ;;EOR^
144 ;;KEY^860.8:^EQUALS TERM OPERATOR
145 ;;R^"860.8:",.01,"E"
146 ;;D^EQUALS TERM OPERATOR
147 ;;R^"860.8:",.02,"E"
148 ;;D^EQTERM
149 ;;R^"860.8:",100,1
150 ;;D^ ;EQTERM(DATA,TERM) ;
151 ;;R^"860.8:",100,2
152 ;;D^ ; ;
153 ;;R^"860.8:",100,3
154 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
155 ;;R^"860.8:",100,4
156 ;;D^ ; N OCXF,OCXL
157 ;;R^"860.8:",100,5
158 ;;D^ ; ;
159 ;;R^"860.8:",100,6
160 ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
161 ;;R^"860.8:",100,7
162 ;;D^T-; Q:'OCXF 0
163 ;;R^"860.8:",100,8
164 ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
165 ;;R^"860.8:",100,9
166 ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
167 ;;R^"860.8:",100,10
168 ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
169 ;;R^"860.8:",100,11
170 ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
171 ;;R^"860.8:",100,12
172 ;;D^T-; Q 0
173 ;;R^"860.8:",100,13
174 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
175 ;;R^"860.8:",100,14
176 ;;D^ ; ;
177 ;;EOR^
178 ;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
179 ;;R^"860.8:",.01,"E"
180 ;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
181 ;;R^"860.8:",.02,"E"
182 ;;D^FILE
183 ;;R^"860.8:",1,1
184 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
185 ;;R^"860.8:",1,2
186 ;;D^ ; ; in the Order Check Patient Data File
187 ;;R^"860.8:",1,3
188 ;;D^ ; ;
189 ;;R^"860.8:",100,1
190 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
191 ;;R^"860.8:",100,2
192 ;;D^ ; ;
193 ;;R^"860.8:",100,3
194 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
195 ;;R^"860.8:",100,4
196 ;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
197 ;;R^"860.8:",100,5
198 ;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
199 ;;R^"860.8:",100,6
200 ;;D^ ; ;
201 ;;R^"860.8:",100,7
202 ;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
203 ;;R^"860.8:",100,8
204 ;;D^ ; ;
205 ;;R^"860.8:",100,9
206 ;;D^ ; S OCXDATA(DFN,OCXELE)=1
207 ;;R^"860.8:",100,10
208 ;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
209 ;;R^"860.8:",100,11
210 ;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
211 ;;R^"860.8:",100,12
212 ;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
213 ;;R^"860.8:",100,13
214 ;;D^ ; ;
215 ;;R^"860.8:",100,14
216 ;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
217 ;;R^"860.8:",100,15
218 ;;D^ ; ;
219 ;;R^"860.8:",100,16
220 ;;D^ ; Q 0
221 ;;R^"860.8:",100,17
222 ;;D^ ; ;
223 ;;EOR^
224 ;;KEY^860.8:^GENERATE STRING CHECKSUM
225 ;;R^"860.8:",.01,"E"
226 ;1;
227 ;
Note: See TracBrowser for help on using the repository browser.