source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOOT.m@ 1141

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

initial load of WorldVistAEHR

File size: 8.9 KB
Line 
1ONCOOT ;HIRMFO/GWB - Miscellaneous Output Transforms ;7/10/96
2 ;;2.11;ONCOLOGY;**6,11,15,18,22,24,25,27,29,34,35,36,37,39,40,42,46**;Mar 07, 1995;Build 39
3 ;
4RNE ;REGIONAL LYMPH NODES EXAMINED (165.5,33)
5 S DXDT=$P($G(^ONCO(165.5,D0,0)),U,16)
6 I DXDT<2980000 D
7 .I Y=0 S Y="No nodes were examined" Q
8 .I (+Y>0)&(+Y<97) S:$L(Y)=1 Y=0_Y Q
9 .I Y=97 S Y="97 or more nodes examined" Q
10 .I Y=98 S Y="Nodes examined, # not specified" Q
11 .I Y=99 S Y="Unknown if nodes examined, NA" Q
12 I DXDT>2971231 D
13 .I Y=0 S Y="No nodes examined" Q
14 .I (+Y>0)&(+Y<90) S:$L(Y)=1 Y=0_Y Q
15 .I Y=90 S Y="90 or more nodes examined" Q
16 .I Y=95 S Y="No nodes removed, aspiration performed" Q
17 .I Y=96 S Y="Node removal as sampling, # unknown" Q
18 .I Y=97 S Y="Node removal as dissection, # unknown" Q
19 .I Y=98 S Y="Nodes surgically removed, # unknown" Q
20 .I Y=99 S Y="Unknown, NA or -, not stated" Q
21 Q
22 ;
23RNP ;REGIONAL LYMPH NODES POSITIVE (165.5,32)
24 I Y=0 S Y="All nodes examined are negative" Q
25 I (+Y>0)&(+Y<90) S:$L(Y)=1 Y=0_Y Q
26 I Y=90 S Y="90 or more nodes are positive" Q
27 I Y=95 S Y="95 Positive aspiration was performed" Q
28 I Y=97 S Y="Positive nodes, # not specified" Q
29 I Y=98 S Y="No nodes were examined" Q
30 I Y=99 S Y="Unknown if nodes +, NA, not stated" Q
31 Q
32 ;
33BP ;BIOPSY PROCEDURE (165.5,141)
34 Q:Y=""
35 D BPGUCHK^ONCOTNE
36 I BPSITE="" Q
37 S Y=$S($P($G(^ONCO(164,BPSITE,"BP5",Y,0)),U,1)'="":$P($G(^ONCO(164,BPSITE,"BP5",Y,0)),U,1),1:Y)
38 Q
39 ;
40 ;1998 Prostate Cancer Study
41 ;
42PSA ;PSA (165.5,684)
43 I Y=999.6 S Y=Y_" or higher"
44 I Y=999.7 S Y="No PSA test performed"
45 I Y=999.8 S Y="Done, results unknown or not reported"
46 I Y=999.9 S Y="Unknown if test performed"
47 Q
48 ;
49DCISIT ;DCIS PRESENT (165.5,930) INPUT TRANSFORM
50 I X'?1N K X Q
51 I X=5!(X=6)!(X=7) K X Q
52 I X=0 D EN^DDIOL(" No, DCIS not present")
53 I X=1 D EN^DDIOL(" Yes, separate tumor")
54 I X=2 D EN^DDIOL(" Yes, mixed histology component")
55 I X=3 D EN^DDIOL(" Yes, separate tumor and mixed histology")
56 I X=4 D EN^DDIOL(" Yes, unk if separate tumor/mixed histology")
57 I X=8 D EN^DDIOL(" NA, reported tumor not invasive DC")
58 I X=9 D EN^DDIOL(" Unknown if DCIS present")
59 Q
60DCISOT ;DCIS PRESENT (165.5,930) OUTPUT TRANSFORM
61 I Y=0 S Y="No, DCIS not present"
62 I Y=1 S Y="Yes, separate tumor"
63 I Y=2 S Y="Yes, mixed histology component"
64 I Y=3 S Y="Yes, separate tumor and mixed histology"
65 I Y=4 S Y="Yes, unk if separate tumor/mixed histology"
66 I Y=8 S Y="NA, reported tumor not invasive DC"
67 I Y=9 S Y="Unknown if DCIS present"
68 Q
69DCISHP ;DCIS PRESENT (165.5,930) HELP
70 W !!?6,"Choose from:"
71 W !?8,"0 No, DCIS not present"
72 W !?8,"1 Yes, separate tumor"
73 W !?8,"2 Yes, mixed histology component"
74 W !?8,"3 Yes, separate tumor and mixed histology"
75 W !?8,"4 Yes, unk if separate tumor/mixed histology"
76 W !?8,"8 NA, reported tumor not invasive DC"
77 W !?8,"9 Unknown if DCIS present"
78 Q
79DCSZIT ;
80 I +X=0 D EN^DDIOL(" Invasive DC reported, DCIS not present")
81 I X="888" D EN^DDIOL(" NA, invasive DC not reported")
82 I X="988" D EN^DDIOL(" Invasive DC reported, DCIS present, size unknown")
83 I X="999" D EN^DDIOL(" Invasive DC reported, unknown if DCIS present")
84 Q
85DCSZOT ;
86 S Y=$S($L(Y)=1:"00"_Y,$L(Y)=2:"0"_Y,1:Y)
87 I Y="000" S Y="Invasive DC reported, DCIS not present"
88 I Y="888" S Y="NA, invasive DC not reported"
89 I Y="988" S Y="Invasive DC reported, DCIS present, size unknown"
90 I Y="999" S Y="Invasive DC reported, unknown if DCIS present"
91 Q
92CGYIT ;
93 I +X=0 D EN^DDIOL(" No radiation given")
94 I X=88888 D EN^DDIOL(" Radiation given, dose unknown")
95 I X=99999 D EN^DDIOL(" Unknown if radiation given")
96 Q
97CGYOT ;
98 S Y=$S($L(Y)=1:"0000"_Y,$L(Y)=2:"000"_Y,$L(Y)=3:"00"_Y,$L(Y)=4:"0"_Y,1:Y)
99 I Y="00000" S Y="No radiation given"
100 I Y=88888 S Y="Radiation given, dose unknown"
101 I Y=99999 S Y="Unknown if radiation given"
102 Q
103STIT ;Tumor Size (165.5,29)
104 S TOP=$P($G(^ONCO(165.5,D0,2)),U,1)
105 I '$D(X) Q
106 I (X>999)!(X<0) K X Q
107 I X="000" W " No mass or tumor found" Q
108 I X=990 W " Microscopic focus, no size given" Q
109 I X=999 W " Unknown; not stated; NA" Q
110 I $$MELANOMA^ONCOU55(D0),TOP'=67691,TOP'=67692,TOP'=67693,TOP'=67694,TOP'=67698,TOP'=67699 D Q
111 .I X=989 W " Melanoma > or = 9.89 mm in depth" Q
112 .I X>9.89 W " Use code 989 for melanomas > 9.89 mm in depth" K X Q
113 .I X?1N S X=X_"00" Q ; 1 -> 100
114 .I X?1P1N S X="0"_$P(X,".",2)_"0" Q ; .1 -> 010
115 .I X?1P2N S X="0"_$P(X,".",2) Q ; .01 -> 001
116 .I X?1N1P1N S X=$P(X,".",1)_$P(X,".",2)_0 Q ; 0.1 -> 010
117 .I X?1N1P2N S X=$P(X,".",1)_$P(X,".",2) Q ; 0.01 -> 001
118 .I X?1N1P3N W " Too many decimal places" K X Q ;0.012
119 .K X
120 I X=989 W " 989 mm or larger" Q
121 I X["." W " No decimal point allowed" K X Q
122 I X=998 D Q
123 .I TOP="" W " No PRIMARY SITE specified" K X Q
124 .I TOP>67149,TOP<67160 W " Entire circumference" Q
125 .I TOP>67159,TOP<67170 W " Diffuse; widespread; linitis plastica" Q
126 .I TOP>67179,TOP<67210 W " Familial/multiple polyposis" Q
127 .I TOP>67339,TOP<67350 W " Diffuse, entire lobe of lung" Q
128 .I TOP>67499,TOP<67510 W " Diffuse; widespread; inflam carcinoma" Q
129 .W !
130 .W !," Code 998 may only be used with the following sites:"
131 .W !
132 .W !," Esophagus (C15.0-C15.9)"
133 .W !," Stomach (C16.0-C16.9)"
134 .W !," Colorectal (C18.0-C20.9)"
135 .W !," Lung (C34.0-C34.9)"
136 .W !," Breast (C50.0-C50.9)"
137 .W !
138 .K X
139 S X=$S($L(X)=1:"00"_X,$L(X)=2:"0"_X,1:X)
140 I X'?3N K X Q
141 I (X=991)!(X=992)!(X=993)!(X=994)!(X=995)!(X=996)!(X=997) K X
142 Q
143 ;
144STOT ;Size of Tumor (165.5,29)
145 S TOP=$P($G(^ONCO(165.5,D0,2)),U,1)
146 I Y="000" S Y="No mass or tumor found" Q
147 I Y=990 S Y="Microscopic focus, no size given" Q
148 I Y=999 S Y="Unknown; not stated; NA" Q
149 I $$MELANOMA^ONCOU55(D0),TOP'=67691,TOP'=67692,TOP'=67693,TOP'=67694,TOP'=67698,TOP'=67699,Y=989 D Q
150 .S Y="Melanoma > or = 9.89 mm in depth"
151 I $$MELANOMA^ONCOU55(D0),TOP'=67691,TOP'=67692,TOP'=67693,TOP'=67694,TOP'=67698,TOP'=67699,Y'="" D
152 .S Y=$E(Y,1)_"."_$E(Y,2,3)
153 I Y=989 S Y="989 mm or larger" Q
154 I Y=998 D Q
155 .I TOP="" S Y="" Q
156 .I TOP>67149,TOP<67160 S Y="Entire circumference" Q
157 .I TOP>67159,TOP<67170 S Y="Diffuse; widespread; linitis plastica" Q
158 .I TOP>67179,TOP<67210 S Y="Familial/multiple polyposis" Q
159 .I TOP>67339,TOP<67350 S Y="Diffuse, entire lobe of lung" Q
160 .I TOP>67499,TOP<67510 S Y="Diffuse; widespread; inflam carcinoma" Q
161 .S:Y'="" Y=Y_" mm"
162 S:Y'="" Y=Y_" mm"
163 Q
164 ;
165STMIT ;Size of Tumor (Melanoma) Item #23 1999 Melanoma PCE Study
166 I X'?1.3N K X Q
167 S X=+X
168 I X=998 D EN^DDIOL(" Mucosal melanoma") Q
169 I X=999 D EN^DDIOL(" Unknown; not recorded; NA")
170 Q
171 ;
172STMOT ;Size of Tumor (Melanoma) Item #23 1999 Melanoma PCE Study
173 I Y=998 S Y="Mucosal melanoma" Q
174 I Y=999 S Y="Unknown; not recorded; NA" Q
175 S Y=Y_" mm"
176 Q
177 ;
178 ;2000 Primary Intracranial/CNS Tumors PCE Study
179TSIT ;Item 33. Tumor Size
180 I X'?1.3N K X Q
181 S X=+X
182 I X=999 D EN^DDIOL(" Unknown, cannot be determined, not recorded")
183 Q
184TSOT ;Item 33. Tumor Size
185 I Y=999 S Y="Unknown, cannot be determined, not recorded" Q
186 S Y=Y_" mm"
187 Q
188SRPTIT ;Item 46. Size of Residual Primary Tumor Following Cancer-Directed
189 ;Surgery
190 I X'?1.3N K X Q
191 S X=+X
192 I X=0 D EN^DDIOL(" No residual tumor") Q
193 I X=995 D EN^DDIOL(" Size not specified, tumor judged smaller") Q
194 I X=996 D EN^DDIOL(" Size not specified, tumor judged unchanged") Q
195 I X=997 D EN^DDIOL(" Size not specified, tumor judged larger") Q
196 I X=998 D EN^DDIOL(" NA, surgical treatment not administered") Q
197 I X=999 D EN^DDIOL(" Unknown, tumor not evaluated")
198 Q
199SRPTOT ;Item 46. Size of Residual Primary Tumor Following Cancer-Directed
200 ;Surgery
201 I Y="000" S Y="No residual tumor" Q
202 I Y=995 S Y="Size not specified, tumor judged smaller" Q
203 I Y=996 S Y="Size not specified, tumor judged unchanged" Q
204 I Y=997 S Y="Size not specified, tumor judged larger" Q
205 I Y=998 S Y="NA, surgical treatment not administered" Q
206 I Y=999 S Y="Unknown, tumor not evaluated" Q
207 S Y=Y_" mm"
208 Q
209 ;
210SOC ;Sets of codes
211 Q:Y=""
212 S SOC=$P(^DD(FILNUM,FLDNUM,0),U,3),YY=Y_":"
213 S J=$F(SOC,YY),JJ=$F(SOC,";",J)-2,Y=Y_" "_$E(SOC,J,JJ)
214 K FILNUM,FLDNUM,J,JJ,SOC,YY
215 Q
216 ;
217TAHIST ;Screen for TOBACCO HISTORY (160,38) and ALCOHOL HISTORY (160,39)
218 S ACDT=0,NUM=0,ACY=$O(^ONCO(165.5,"AC",DA,""))
219 I ACY="" Q
220 S ACN=$E(ACY,1,4)
221 I (ACN>1998) S ACDT=1999
222 I Y?1N S NUM=1
223 Q
224 ;
225RE ;2001 Lung (NSCLC) Cancers PCE Study
226 ; Item 9. Radiological Evaluation
227 ; LNG TUMOR SIZE (BONE SCAN) (165.5,1409.4)
228 ; LNG NUM OF TUMORS (BONE SCAN) (165.5,1409.5)
229 ; LNG TUMOR SIZE (CHEST CT) (165.5,1410.4)
230 ; LNG NUM OF TUMORS (CHEST CT) (165.5,1410.5)
231 ; LNG TUMOR SIZE (BRAIN CT) (165.5,1411.4)
232 ; LNG NUM OF TUMORS (BRAIN CT) (165.5,1411.5)
233 ; LNG TUMOR SIZE (CHEST MRI) (165.5,1412.4)
234 ; LNG NUM OF TUMORS (CHEST MRI) (165.5,1412.5)
235 ; LNG TUMOR SIZE (BRAIN MRI) (165.5,1413.4)
236 ; LNG NUM OF TUMORS (BRAIN MRI) (165.5,1413.5)
237 ; LNG TUMOR SIZE (PET SCAN) (165.5,1414.4)
238 ; LNG NUM OF TUMORS (PET SCAN) (165.5,1414.5)
239 ; LNG TUMOR SIZE (CHEST XRAY) (165.5,1415.4)
240 ; LNG NUM OF TUMORS (CHEST XRAY) (165.5,1415.5)
241 I +Y=0 S Y="Test not performed"
242 I Y=999!(Y=99) S Y="Test performed, not documented"
243 Q
Note: See TracBrowser for help on using the repository browser.