close Warning: Can't use blame annotator:
svn blame failed on WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOIT.m: 'GenericSWIGWrapper' object has no attribute '_wrap'

source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOIT.m@ 789

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

initial load of WorldVistAEHR

File size: 7.2 KB
RevLine 
1ONCOIT ;Hines OIFO/GWB - Miscellaneous Input Transforms ;7/10/96
2 ;;2.11;ONCOLOGY;**18,19,28,29,33,36,40**;Mar 07, 1995
3 ;
4NP ;NO PUNCTUATION
5 ;PATIENT ADDRESS AT DX (165.5,8)
6 ;CITY/TOWN AT DX (165.5,8.1)
7 ;POSTAL CODE AT DX (165.5,9)
8 S X1=$$STRIP^XLFSTR(X,"!""""#$%&'()*+,-./:;<=>?[>]^_\{|}~`")
9 I X'=X1 K X W " Punctuation not allowed" K X1 Q
10 S X1=$TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
11 I X'=X1 K X W " Lowercase text not allowed" K X1 Q
12 Q
13 ;
14RNEIT ;REGIONAL NODES EXAMINED (165.5,33)
15 I (X=91)!(X=92)!(X=93)!(X=94) K X Q
16 S DXDT=$P($G(^ONCO(165.5,D0,0)),U,16)
17 I DXDT<2980000 D
18 .I X=0 W " No nodes examined" Q
19 .I X=97 W " 97 or more nodes examined" Q
20 .I X=98 W " Nodes examined, # not specified" Q
21 .I X=99 W " Unknown if nodes examined, NA" Q
22 I DXDT>2971231 D
23 .I X=0 W " No nodes examined" Q
24 .I X=90 W " 90 or more nodes examined" Q
25 .I X=95 W " No nodes removed, aspiration performed" Q
26 .I X=96 W " Node removal as sampling, # unknown" Q
27 .I X=97 W " Node removal as dissection, # unknown" Q
28 .I X=98 W " Nodes surgically removed, # unknown" Q
29 .I X=99 W " Unknown, NA or -, not stated" Q
30 Q
31 ;
32RNPIT ;REGIONAL LYMPH NODES POSITIVE (165.5,32)
33 I (X=91)!(X=92)!(X=93)!(X=94)!(X=96) W " Invalid value" K X Q
34 I X=0 W " All nodes examined are negative" Q
35 I X=90 W " 90 or more nodes are positive" Q
36 I X=95 W " Positive aspiration was performed" Q
37 I X=97 W " Positive nodes, # not specified" Q
38 I X=98 W " No nodes were examined" Q
39 I X=99 W " Unknown if nodes +, NA, not stated" Q
40 Q
41 ;
42BP ;BIOPSY PROCEDURE (165.5,141)
43 S XCODE=X
44 D BPGUCHK^ONCOTNE
45 I BPSITE="" K X Q
46 S FOUND=0
47 F XBP=0:0 S XBP=$O(^ONCO(164,BPSITE,"BP5",XBP)) Q:XBP'>0!(FOUND=1) D
48 .I $P(^ONCO(164,BPSITE,"BP5",XBP,0),U,2)=X S X=XBP,FOUND=1 Q
49 I FOUND=0 K X Q
50 D EN^DDIOL($P(^ONCO(164,BPSITE,"BP5",X,0),U,1))
51 K FOUND,XBP Q
52 ;
53RDIT ;REGIONAL DOSE:cGy (165.5,442)
54 I X'?1.5N K X Q
55 D NUMIT
56 I +X=0 W " No radiation administered"
57 I +X=88888 W " NA, brachytherapy/radioisotopes administered"
58 I X=99999 W " Dose unknown/unknown if administered"
59 Q
60 ;
61 ;1998 Prostate Cancer Study
62 ;
63PSA ;Item 14. Results of Most Recent Pre-Treatment Prostate Specific
64 ; Antigen (PSA) Test
65 ;RESULTS OF PSA TEST (PR98) (165.5,684)
66 I X'?1.3N&(X'?0.3N1"."1N) K X Q
67 I X'["." S X=X_".0"
68 I $P(X,".",1)="" S X="000"_X
69 I $L($P(X,".",1))=1 S X="00"_X
70 I $L($P(X,".",1))=2 S X="0"_X
71 Q
72 ;
73LP25 ;Item 25. Gleason's Score for Biopsy, Local Resection, or Simple
74 ; Prostatectomy
75 ;LESSER PATTERN (02-40) (165.5,623.2)
76 I +X'=X!(X=6)!(X=7)!(X=8)!($L(X)>1)!(X<0)!(X?.E1"."1N.N) K X Q
77 S PP=$P($G(^ONCO(165.5,D0,"PRO2")),U,43)
78 I PP>0,PP<6,(X=0)!(X=9) K X
79 K PP
80 Q
81 ;
82LP26 ;Item 26. Gleason's Score for Radical Prostatectomy
83 ;LESSER PATTERN (50-70) (165.5,623.5)
84 I +X'=X!(X=6)!(X=7)!(X=8)!($L(X)>1)!(X<0)!(X?.E1"."1N.N) K X Q
85 S PP=$P($G(^ONCO(165.5,D0,"PRO2")),U,46)
86 I PP>0,PP<6,(X=0)!(X=9) K X
87 K PP
88 Q
89 ;
90 ;2001 Gastric Cancers PCE Study
91 ;
92AC ;Item 3. Alcohol Consumption
93 ;GAS ALCOHOL COMSUMPTION (165.5,1501)
94 D NUMIT
95 I +X=0 W " Never consumed alcohol"
96 I X=97 W " 97 or more drinks per week"
97 I X=98 W " Yes, number of drinks unknown"
98 I X=99 W " Not documented"
99 Q
100 ;
101LS ;Item 16. Laboratory Studies
102 ;GAS LDH (IU/L) (165.5,1540)
103 ;GAS CEA (ng/ml) (165.5,1541)
104 ;GAS CA125 (U/ml) (165.5,1542)
105 ;GAS BETA2 MICROGLOBULIN (165.5,1543)
106 ;GAS URINARY 5-HIAA (mg/24hr) (165.5,1544)
107 D FRACIT
108 I +X=0 W " Test not administered"
109 I X=8888.8 W " Test administered but results unknown"
110 I X=9999.9 W " Not documented"
111 Q
112 ;
113IRTD ;Item 40. Intra-operative Radiation Therapy, Dose (cCy)
114 ;GAS INTRA-OPERATIVE RADIATION (165.5,1567)
115 D NUMIT
116 I +X=0 W " Not administered"
117 I X=88888 W " Administered, dose not documented"
118 I X=99999 W " Not documented"
119 Q
120 ;
121 ;2001 Lung (NSCLC) Cancers PCE Study
122 ;
123PFT ;Item 7. Pulmonary Function Tests
124 ;LNG FVC (165.5,1407
125 ;LNG FEV (165.5,1407.1)
126 I $L($P(X,".",1))>ONCL K X Q
127 D FRACIT
128 I X="0.00" W " Test not done" Q
129 I X=9.98 W " Test done, results not documented" Q
130 I X=9.99 W " Not documented if test performed" Q
131 Q
132 ;
133RE ;Item 9. Radiological Evaluation
134 ;LNG TUMOR SIZE (BONE SCAN) (165.5,1409.4)
135 ;LNG NUM OF TUMORS (BONE SCAN) (165.5,1409.5)
136 ;LNG TUMOR SIZE (CHEST CT) (165.5,1410.4)
137 ;LNG NUM OF TUMORS (CHEST CT) (165.5,1410.5)
138 ;LNG TUMOR SIZE (BRAIN CT) (165.5,1411.4)
139 ;LNG NUM OF TUMORS (BRAIN CT) (165.5,1411.5)
140 ;LNG TUMOR SIZE (CHEST MRI) (165.5,1412.4)
141 ;LNG NUM OF TUMORS (CHEST MRI) (165.5,1412.5)
142 ;LNG TUMOR SIZE (BRAIN MRI) (165.5,1413.4)
143 ;LNG NUM OF TUMORS (BRAIN MRI) (165.5,1413.5)
144 ;LNG TUMOR SIZE (PET SCAN) (165.5,1414.4)
145 ;LNG NUM OF TUMORS (PET SCAN) (165.5,1414.5)
146 ;LNG TUMOR SIZE (CHEST XRAY) (165.5,1415.4)
147 ;LNG NUM OF TUMORS (CHEST XRAY) (165.5,1415.5)
148 D NUMIT
149 I +X=0 W " Test not performed"
150 I X=999!(X=99) W " Test performed, not documented"
151 Q
152 ;
153TPBR ;Item 17. Total Peri-Operative Blood Replacement
154 ;LNG PERI-OPERATIVE BLOOD REP (165.5,1420)
155 D NUMIT
156 I +X=0 W " No transfusion performed"
157 I X=98 W " Transfusion performed, units not documented"
158 I X=99 W " Not recorded if transfusion done"
159 Q
160 ;
161 ;2001 Lung (NSCLC) Cancers PCE Study
162 ;2001 Gastric Cancers PCE Study
163 ;
164DTU ;Item 2. Duration of Tobacco Use
165 ;LNG DURATION OF TOBACCO USE (165.5,1401)
166 ;Item 4. Duration of Tobacco Use
167 ;GAS DURATION OF TOBACCO USE (165.5,1572)
168 D NUMIT
169 I +X=0 W " Never used tobacco"
170 I X=99 W " Not documented"
171 Q
172 ;
173GYGR ;YEAR OF GASTRIC RESECTION I.T.
174 I +X=0 W " No prior gastric resection"
175 I X=9999 W " Not documented"
176 Q
177GTOBR ;GASTRIC TOTAL OPERATIVE BLOOD REPLACEMENT I.T.
178 I X="00" W " No transfusion"
179 I X="98" W " Transfusion, # of units not documented"
180 I X="99" W " Not recorded if transfusion done"
181 Q
182HVBT ;Item 16. Hct (Hematocrit) Values Before Transfusion
183 ;LNG HCT VAL BEFORE TRANSFUSION (165.5,1430)
184 ;Item 33. Hct (Hematocrit) Values Before Transfusion
185 ;GAS HCT VAL BEFORE TRANSFUSION (165.5,1562)
186 D FRACIT
187 I +X=0 W " No transfusion"
188 I X=99.9 W " Not documented"
189 Q
190 ;
191BD ;Item 23. Boost Dose (cCy)
192 ;LNG BOOST DOSE (cGy) (165.5,1422)
193 ;Item 39. Boost Dose (cCy)
194 ;GAS BOOST DOSE (cGy) (165.5,1575)
195 D NUMIT
196 I +X=0 W " Not administered"
197 I X=99999 W " Not documented"
198 Q
199 ;
200DMCM ;Item 12. Distance in Millimeters to Closest Margin
201 ;LNG PROXIMAL MARGIN (165.5,1429)
202 ;LNG DISTAL MARGIN (165.5,1429.1)
203 D NUMIT
204 I +X=0 W " No free margins"
205 I X=998 W " NA, no surgery of primary site"
206 I X=999 W " Unknown, not documented"
207 Q
208 ;
209EFM ;Item 30. Extent of Free Margin
210 ;GAS PROXIMAL MARGIN (165.5,1558)
211 ;GAS DISTAL MARGIN (165.5,1558.1)
212 D NUMIT
213 I +X=0 W " No free margins"
214 I X=999 W " Not documented"
215 Q
216 ;
217NUMIT ;Pad with leading zeros
218 S ONCZZZ="000000000",ONCXLEN=$L(X) I ONCL=ONCXLEN Q
219 S ONCPNUM=ONCL-ONCXLEN,ONCPAD=$E(ONCZZZ,1,ONCPNUM),X=ONCPAD_X
220 K ONCZZZ,ONCXLEN,ONCPNUM,ONCPAD
221 Q
222 ;
223FRACIT ;Pad with leading zeros, 1 decimal place
224 I X[".",$P(X,".",2)="" S X=+X
225 S ONCZZZ="000000000",ONCNUM=$P(X,".",1),ONCFRAC=$P(X,".",2)
226 S ONCNLEN=$L(ONCNUM),ONCFLEN=$L(ONCFRAC)
227 S ONCNPD=ONCL-ONCNLEN,ONCFPD=ONCF-ONCFLEN
228 S ONCPADN=$E(ONCZZZ,1,ONCNPD),ONCPADF=$E(ONCZZZ,1,ONCFPD)
229 I ONCFRAC="" S ONCPADF="."_ONCPADF
230 S X=ONCPADN_X_ONCPADF
231 K ONCZZZ,ONCNUM,ONCFRAC,ONCNLEN,ONCFLEN,ONCNPD,ONCFPD,ONCPADN,ONCPADF
232 Q
Note: See TracBrowser for help on using the repository browser.