source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORY22107.m@ 1383

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

initial load of FOIAVistA 6/30/08 version

File size: 7.1 KB
Line 
1ORY22107 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*221) ;AUG 30,2005 at 11:41
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**221**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5S ;
6 ;
7 D DOT^ORY221ES
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 ^ORY22108
15 ;
16 Q
17 ;
18DATA ;
19 ;
20 ;;R^"860.8:",100,2
21 ;;D^ ; ; date into an Externl Format (Human Readable) date. 'OCXF=SHORT FORMAT OCXF=LONG FORMAT
22 ;;R^"860.8:",100,3
23 ;;D^ ; ;
24 ;;R^"860.8:",100,4
25 ;;D^ ; Q:'$L($G(OCXDT)) "" S OCXF=+$G(OCXF)
26 ;;R^"860.8:",100,5
27 ;;D^ ; N OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXCYR
28 ;;R^"860.8:",100,6
29 ;;D^ ; S (OCXYR,OCXLPYR,OCXMON,OCXDAY,OCXHR,OCXMIN,OCXSEC,OCXAP)=""
30 ;;R^"860.8:",100,7
31 ;;D^ ; S OCXSEC=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
32 ;;R^"860.8:",100,8
33 ;;D^ ; S OCXMIN=$E(OCXDT#60+100,2,3),OCXDT=OCXDT\60
34 ;;R^"860.8:",100,9
35 ;;D^ ; S OCXHR=$E(OCXDT#24+100,2,3),OCXDT=OCXDT\24
36 ;;R^"860.8:",100,10
37 ;;D^ ; S OCXCYR=($H\1461)*4+1841+(($H#1461)\365)
38 ;;R^"860.8:",100,11
39 ;;D^ ; S OCXYR=(OCXDT\1461)*4+1841,OCXDT=OCXDT#1461
40 ;;R^"860.8:",100,12
41 ;;D^ ; S OCXLPYR=(OCXDT\365),OCXDT=OCXDT-(OCXLPYR*365),OCXYR=OCXYR+OCXLPYR
42 ;;R^"860.8:",100,13
43 ;;D^ ; S OCXCNT="031^059^090^120^151^181^212^243^273^304^334^365"
44 ;;R^"860.8:",100,14
45 ;;D^ ; S:(OCXLPYR=3) OCXCNT="031^060^091^121^152^182^213^244^274^305^335^366"
46 ;;R^"860.8:",100,15
47 ;;D^ ; F OCXMON=1:1:12 Q:(OCXDT<$P(OCXCNT,U,OCXMON))
48 ;;R^"860.8:",100,16
49 ;;D^ ; S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
50 ;;R^"860.8:",100,17
51 ;;D^ ; I OCXF S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
52 ;;R^"860.8:",100,18
53 ;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
54 ;;R^"860.8:",100,19
55 ;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
56 ;;R^"860.8:",100,20
57 ;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
58 ;;R^"860.8:",100,21
59 ;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
60 ;;R^"860.8:",100,22
61 ;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
62 ;;R^"860.8:",100,23
63 ;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
64 ;;R^"860.8:",100,24
65 ;;D^ ; ;
66 ;;EOR^
67 ;;KEY^860.8:^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
68 ;;R^"860.8:",.01,"E"
69 ;;D^CREATININE CLEARANCE (ESTIMATED/CALCULATED)
70 ;;R^"860.8:",.02,"E"
71 ;;D^CRCL
72 ;;R^"860.8:",1,1
73 ;;D^The CrCl algorithm uses adjusted body weight if patient height is > 60
74 ;;R^"860.8:",1,2
75 ;;D^inches. Approved by the CPRS Clinical Workgroup 8/11/04, it is based on a
76 ;;R^"860.8:",1,3
77 ;;D^modified Cockcroft-Gault formula and was installed with patch OR*3*221.
78 ;;R^"860.8:",1,4
79 ;;D^For more information:
80 ;;R^"860.8:",1,5
81 ;;D^ http://www.ascp.com/public/pubs/tcp/1999/jan/cockcroft.shtml
82 ;;R^"860.8:",1,6
83 ;;D^
84 ;;R^"860.8:",1,7
85 ;;D^ CrCl (male) = (140 - age) x (adj body weight* in kg)
86 ;;R^"860.8:",1,8
87 ;;D^ --------------------------------------
88 ;;R^"860.8:",1,9
89 ;;D^ (serum creatinine) x 72
90 ;;R^"860.8:",1,10
91 ;;D^ * If patient height is not greater than 60 inches, actual body weight
92 ;;R^"860.8:",1,11
93 ;;D^ is used.
94 ;;R^"860.8:",1,12
95 ;;D^ CrCl (female) = 0.85 x CrCl (male)
96 ;;R^"860.8:",1,13
97 ;;D^
98 ;;R^"860.8:",1,14
99 ;;D^To calculate adjusted body weight, the following equations are used:
100 ;;R^"860.8:",1,15
101 ;;D^Ideal body weight (IBW) = 50 kg x (for men) or 45 kg x (for women) +
102 ;;R^"860.8:",1,16
103 ;;D^ 2.3 x (height in inches - 60)
104 ;;R^"860.8:",1,17
105 ;;D^Adjusted body weight (Adj. BW) if the ratio of actual BW/IBW > 1.3 =
106 ;;R^"860.8:",1,18
107 ;;D^ (0.3 x (Actual BW - IBW)) + IBW
108 ;;R^"860.8:",1,19
109 ;;D^Adjusted body weight if the ratio of actual BW/IBW is not > 1.3 =
110 ;;R^"860.8:",1,20
111 ;;D^ IBW or Actual BW (whichever is less)
112 ;;R^"860.8:",100,1
113 ;;D^ ;CRCL(DFN) ;
114 ;;R^"860.8:",100,2
115 ;;D^ ; ;
116 ;;R^"860.8:",100,3
117 ;;D^ ; N HT,AGE,SEX,SCR,SCRD,CRCL,LRWKLD,RSLT,ORW,ORH,PSCR
118 ;;R^"860.8:",100,4
119 ;;D^ ; N HTGT60,ABW,IBW,BWRATIO,BWDIFF,LOWBW,ADJBW
120 ;;R^"860.8:",100,5
121 ;;D^ ; S RSLT="0^<Unavailable>"
122 ;;R^"860.8:",100,6
123 ;;D^ ; S PSCR="^^^^^^0"
124 ;;R^"860.8:",100,7
125 ;;D^ ; D VITAL^ORQQVI("WEIGHT","WT",DFN,.ORW,0,"",$$NOW^XLFDT)
126 ;;R^"860.8:",100,8
127 ;;D^ ; Q:'$D(ORW) RSLT
128 ;;R^"860.8:",100,9
129 ;;D^ ; S ABW=$P(ORW(1),U,3) Q:+$G(ABW)<1 RSLT
130 ;;R^"860.8:",100,10
131 ;;D^ ; S ABW=ABW/2.2 ;ABW (actual body weight) in kg
132 ;;R^"860.8:",100,11
133 ;;D^ ; D VITAL^ORQQVI("HEIGHT","HT",DFN,.ORH,0,"",$$NOW^XLFDT)
134 ;;R^"860.8:",100,12
135 ;;D^ ; Q:'$D(ORH) RSLT
136 ;;R^"860.8:",100,13
137 ;;D^ ; S HT=$P(ORH(1),U,3) Q:+$G(HT)<1 RSLT
138 ;;R^"860.8:",100,14
139 ;;D^ ; S AGE=$$AGE^ORQPTQ4(DFN) Q:'AGE RSLT
140 ;;R^"860.8:",100,15
141 ;;D^ ; S SEX=$P($$SEX^ORQPTQ4(DFN),U,1) Q:'$L(SEX) RSLT
142 ;;R^"860.8:",100,16
143 ;;D^ ; S OCXTL="" Q:'$$TERMLKUP^ORB31(.OCXTL,"SERUM CREATININE") RSLT
144 ;;R^"860.8:",100,17
145 ;;D^ ; S OCXTLS="" Q:'$$TERMLKUP^ORB31(.OCXTLS,"SERUM SPECIMEN") RSLT
146 ;;R^"860.8:",100,18
147 ;;D^ ; S SCR="",OCXT=0 F S OCXT=$O(OCXTL(OCXT)) Q:'OCXT D
148 ;;R^"860.8:",100,19
149 ;;D^ ; .S OCXTS=0 F S OCXTS=$O(OCXTLS(OCXTS)) Q:'OCXTS D
150 ;;R^"860.8:",100,20
151 ;;D^ ; ..S SCR=$$LOCL^ORQQLR1(DFN,$P(OCXTL(OCXT),U),$P(OCXTLS(OCXTS),U))
152 ;;R^"860.8:",100,21
153 ;;D^ ; ..I $P(SCR,U,7)>$P(PSCR,U,7) S PSCR=SCR
154 ;;R^"860.8:",100,22
155 ;;D^ ; S SCR=PSCR,SCRV=$P(SCR,U,3) Q:+$G(SCRV)<.01 RSLT
156 ;;R^"860.8:",100,23
157 ;;D^ ; S SCRD=$P(SCR,U,7) Q:'$L(SCRD) RSLT
158 ;;R^"860.8:",100,24
159 ;;D^ ; ;
160 ;;R^"860.8:",100,25
161 ;;D^ ; S HTGT60=$S(HT>60:(HT-60)*2.3,1:0) ;if ht > 60 inches
162 ;;R^"860.8:",100,26
163 ;;D^ ; I HTGT60>0 D
164 ;;R^"860.8:",100,27
165 ;;D^ ; .S IBW=$S(SEX="M":50+HTGT60,1:45.5+HTGT60) ;Ideal Body Weight
166 ;;R^"860.8:",100,28
167 ;;D^ ; .S BWRATIO=(ABW/IBW) ;body weight ratio
168 ;;R^"860.8:",100,29
169 ;;D^ ; .S BWDIFF=$S(ABW>IBW:ABW-IBW,1:0)
170 ;;R^"860.8:",100,30
171 ;;D^ ; .S LOWBW=$S(IBW<ABW:IBW,1:ABW)
172 ;;R^"860.8:",100,31
173 ;;D^ ; .I BWRATIO>1.3,(BWDIFF>0) S ADJBW=((0.3*BWDIFF)+IBW)
174 ;;R^"860.8:",100,32
175 ;;D^ ; .E S ADJBW=LOWBW
176 ;;R^"860.8:",100,33
177 ;;D^ ; I +$G(ADJBW)<1 D
178 ;;R^"860.8:",100,34
179 ;;D^ ; .S ADJBW=ABW
180 ;;R^"860.8:",100,35
181 ;;D^ ; S CRCL=(((140-AGE)*ADJBW)/(SCRV*72))
182 ;;R^"860.8:",100,36
183 ;;D^ ; ;
184 ;;R^"860.8:",100,37
185 ;;D^ ; S:SEX="M" RSLT=SCRD_U_$J(CRCL,1,1)
186 ;;R^"860.8:",100,38
187 ;;D^ ; S:SEX="F" RSLT=SCRD_U_$J((CRCL*.85),1,1)
188 ;;R^"860.8:",100,39
189 ;;D^ ; Q RSLT
190 ;;R^"860.8:",100,40
191 ;;D^ ; ;
192 ;;EOR^
193 ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
194 ;;R^"860.8:",.01,"E"
195 ;;D^ELAPSED ORDER CHECK TIME LOGGER
196 ;;R^"860.8:",.02,"E"
197 ;;D^TIMELOG
198 ;;R^"860.8:",100,1
199 ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
200 ;;R^"860.8:",100,2
201 ;;D^ ; ;
202 ;;R^"860.8:",100,3
203 ;;D^ ; ;
204 ;;R^"860.8:",100,4
205 ;;D^ ; Q 0
206 ;;R^"860.8:",100,5
207 ;;D^ ; ;
208 ;;EOR^
209 ;;KEY^860.8:^EQUALS TERM OPERATOR
210 ;;R^"860.8:",.01,"E"
211 ;;D^EQUALS TERM OPERATOR
212 ;;R^"860.8:",.02,"E"
213 ;;D^EQTERM
214 ;;R^"860.8:",100,1
215 ;;D^ ;EQTERM(DATA,TERM) ;
216 ;;R^"860.8:",100,2
217 ;;D^ ; ;
218 ;;R^"860.8:",100,3
219 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
220 ;1;
221 ;
Note: See TracBrowser for help on using the repository browser.