ONCOOT ;HIRMFO/GWB - Miscellaneous Output Transforms ;7/10/96
;;2.2;ONCOLOGY;**1,6**;Jul 31, 2013;Build 10
;
RNE ;REGIONAL LYMPH NODES EXAMINED (165.5,33)
S DXDT=$P($G(^ONCO(165.5,D0,0)),U,16)
I DXDT<2980000 D
.I Y=0 S Y="No nodes were examined" Q
.I (+Y>0)&(+Y<97) S:$L(Y)=1 Y=0_Y Q
.I Y=97 S Y="97 or more nodes examined" Q
.I Y=98 S Y="Nodes examined, # not specified" Q
.I Y=99 S Y="Unknown if nodes examined, NA" Q
I DXDT>2971231 D
.I Y=0 S Y="No nodes examined" Q
.I (+Y>0)&(+Y<90) S:$L(Y)=1 Y=0_Y Q
.I Y=90 S Y="90 or more nodes examined" Q
.I Y=95 S Y="No nodes removed, aspiration performed" Q
.I Y=96 S Y="Node removal as sampling, # unknown" Q
.I Y=97 S Y="Node removal as dissection, # unknown" Q
.I Y=98 S Y="Nodes surgically removed, # unknown" Q
.I Y=99 S Y="Unknown, NA or -, not stated" Q
Q
;
RNP ;REGIONAL LYMPH NODES POSITIVE (165.5,32)
I Y=0 S Y="All nodes examined are negative" Q
I (+Y>0)&(+Y<90) S:$L(Y)=1 Y=0_Y Q
I Y=90 S Y="90 or more nodes are positive" Q
I Y=95 S Y="95 Positive aspiration was performed" Q
I Y=97 S Y="Positive nodes, # not specified" Q
I Y=98 S Y="No nodes were examined" Q
I Y=99 S Y="Unknown if nodes +, NA, not stated" Q
Q
;
BP ;BIOPSY PROCEDURE (165.5,141)
Q:Y=""
D BPGUCHK^ONCOTNE
I BPSITE="" Q
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)
Q
;
;1998 Prostate Cancer Study
;
PSA ;PSA (165.5,684)
I Y=999.6 S Y=Y_" or higher"
I Y=999.7 S Y="No PSA test performed"
I Y=999.8 S Y="Done, results unknown or not reported"
I Y=999.9 S Y="Unknown if test performed"
Q
;
DCISIT ;DCIS PRESENT (165.5,930) INPUT TRANSFORM
I X'?1N K X Q
I X=5!(X=6)!(X=7) K X Q
I X=0 D EN^DDIOL(" No, DCIS not present")
I X=1 D EN^DDIOL(" Yes, separate tumor")
I X=2 D EN^DDIOL(" Yes, mixed histology component")
I X=3 D EN^DDIOL(" Yes, separate tumor and mixed histology")
I X=4 D EN^DDIOL(" Yes, unk if separate tumor/mixed histology")
I X=8 D EN^DDIOL(" NA, reported tumor not invasive DC")
I X=9 D EN^DDIOL(" Unknown if DCIS present")
Q
DCISOT ;DCIS PRESENT (165.5,930) OUTPUT TRANSFORM
I Y=0 S Y="No, DCIS not present"
I Y=1 S Y="Yes, separate tumor"
I Y=2 S Y="Yes, mixed histology component"
I Y=3 S Y="Yes, separate tumor and mixed histology"
I Y=4 S Y="Yes, unk if separate tumor/mixed histology"
I Y=8 S Y="NA, reported tumor not invasive DC"
I Y=9 S Y="Unknown if DCIS present"
Q
DCISHP ;DCIS PRESENT (165.5,930) HELP
D EN^DDIOL(" Choose from:")
D EN^DDIOL(" 0 No, DCIS not present")
D EN^DDIOL(" 1 Yes, separate tumor")
D EN^DDIOL(" 2 Yes, mixed histology component")
D EN^DDIOL(" 3 Yes, separate tumor and mixed histology")
D EN^DDIOL(" 4 Yes, unk if separate tumor/mixed histology")
D EN^DDIOL(" 8 NA, reported tumor not invasive DC")
D EN^DDIOL(" 9 Unknown if DCIS present")
Q
DCSZIT ;
I +X=0 D EN^DDIOL(" Invasive DC reported, DCIS not present")
I X="888" D EN^DDIOL(" NA, invasive DC not reported")
I X="988" D EN^DDIOL(" Invasive DC reported, DCIS present, size unknown")
I X="999" D EN^DDIOL(" Invasive DC reported, unknown if DCIS present")
Q
DCSZOT ;
S Y=$S($L(Y)=1:"00"_Y,$L(Y)=2:"0"_Y,1:Y)
I Y="000" S Y="Invasive DC reported, DCIS not present"
I Y="888" S Y="NA, invasive DC not reported"
I Y="988" S Y="Invasive DC reported, DCIS present, size unknown"
I Y="999" S Y="Invasive DC reported, unknown if DCIS present"
Q
CGYIT ;
I +X=0 D EN^DDIOL(" No radiation given")
I X=88888 D EN^DDIOL(" Radiation given, dose unknown")
I X=99999 D EN^DDIOL(" Unknown if radiation given")
Q
CGYOT ;
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)
I Y="00000" S Y="No radiation given"
I Y=88888 S Y="Radiation given, dose unknown"
I Y=99999 S Y="Unknown if radiation given"
Q
STIT ;Tumor Size (165.5,29)
S TOP=$P($G(^ONCO(165.5,D0,2)),U,1)
I '$D(X) Q
I (X>999)!(X<0) K X Q
I X="000" D EN^DDIOL(" No mass or tumor found") Q
I X=990 D EN^DDIOL(" Microscopic focus, no size given") Q
I X=999 D EN^DDIOL(" Unknown; not stated; NA") Q
I $$MELANOMA^ONCOU55(D0),TOP'=67691,TOP'=67692,TOP'=67693,TOP'=67694,TOP'=67698,TOP'=67699 D Q
.I X=989 D EN^DDIOL(" Melanoma > or = 9.89 mm in depth") Q
.I X>9.89 D EN^DDIOL(" Use code 989 for melanomas > 9.89 mm in depth") K X Q
.I X?1N S X=X_"00" Q ; 1 -> 100
.I X?1P1N S X="0"_$P(X,".",2)_"0" Q ; .1 -> 010
.I X?1P2N S X="0"_$P(X,".",2) Q ; .01 -> 001
.I X?1N1P1N S X=$P(X,".",1)_$P(X,".",2)_0 Q ; 0.1 -> 010
.I X?1N1P2N S X=$P(X,".",1)_$P(X,".",2) Q ; 0.01 -> 001
.I X?1N1P3N D EN^DDIOL(" Too many decimal places") K X Q ;0.012
.K X
I X=989 D EN^DDIOL(" 989 mm or larger") Q
I X["." D EN^DDIOL(" No decimal point allowed") K X Q
I X=998 D Q
.I TOP="" D EN^DDIOL(" No PRIMARY SITE specified") K X Q
.I TOP>67149,TOP<67160 D EN^DDIOL(" Entire circumference") Q
.I TOP>67159,TOP<67170 D EN^DDIOL(" Diffuse; widespread; linitis plastica") Q
.I TOP>67179,TOP<67210 D EN^DDIOL(" Familial/multiple polyposis") Q
.I TOP>67339,TOP<67350 D EN^DDIOL(" Diffuse, entire lobe of lung") Q
.I TOP>67499,TOP<67510 D EN^DDIOL(" Diffuse; widespread; inflam carcinoma") Q
.D EN^DDIOL(" ")
.D EN^DDIOL(" Code 998 may only be used with the following sites:")
.D EN^DDIOL(" ")
.D EN^DDIOL(" Esophagus (C15.0-C15.9)")
.D EN^DDIOL(" Stomach (C16.0-C16.9)")
.D EN^DDIOL(" Colorectal (C18.0-C20.9)")
.D EN^DDIOL(" Lung (C34.0-C34.9)")
.D EN^DDIOL(" Breast (C50.0-C50.9)")
.D EN^DDIOL(" ")
.K X
S X=$S($L(X)=1:"00"_X,$L(X)=2:"0"_X,1:X)
I X'?3N K X Q
I (X=991)!(X=992)!(X=993)!(X=994)!(X=995)!(X=996)!(X=997) K X
Q
;
STOT ;Size of Tumor (165.5,29)
S TOP=$P($G(^ONCO(165.5,D0,2)),U,1)
I Y="000" S Y="No mass or tumor found" Q
I Y=990 S Y="Microscopic focus, no size given" Q
I Y=999 S Y="Unknown; not stated; NA" Q
I $$MELANOMA^ONCOU55(D0),TOP'=67691,TOP'=67692,TOP'=67693,TOP'=67694,TOP'=67698,TOP'=67699,Y=989 D Q
.S Y="Melanoma > or = 9.89 mm in depth"
I $$MELANOMA^ONCOU55(D0),TOP'=67691,TOP'=67692,TOP'=67693,TOP'=67694,TOP'=67698,TOP'=67699,Y'="" D
.S Y=$E(Y,1)_"."_$E(Y,2,3)
I Y=989 S Y="989 mm or larger" Q
I Y=998 D Q
.I TOP="" S Y="" Q
.I TOP>67149,TOP<67160 S Y="Entire circumference" Q
.I TOP>67159,TOP<67170 S Y="Diffuse; widespread; linitis plastica" Q
.I TOP>67179,TOP<67210 S Y="Familial/multiple polyposis" Q
.I TOP>67339,TOP<67350 S Y="Diffuse, entire lobe of lung" Q
.I TOP>67499,TOP<67510 S Y="Diffuse; widespread; inflam carcinoma" Q
.S:Y'="" Y=Y_" mm"
S:Y'="" Y=Y_" mm"
Q
;
TSCPSIT ;Tumor Size Clinical/Pathologic/Summary (165.5,29.3;29.4;29.5)
S TOP=$P($G(^ONCO(165.5,D0,2)),U,1)
I '$D(X) Q
I (X>999)!(X<0)!(X=991)!(X=992)!(X=993)!(X=994)!(X=995)!(X=996)!(X=997) K X Q
S X=$S($L(X)=1:"00"_X,$L(X)=2:"0"_X,1:X)
I X="000" D EN^DDIOL(" No mass/tumor found") Q
I X=990 D EN^DDIOL(" Microscopic focus or foci only and no size of focus is given") Q
I X=999 D EN^DDIOL(" Unknown; size not stated; Not documented in patient record; Size of tumor cannot be assessed; NA") Q
I X=989 D EN^DDIOL(" 989 mm or larger") Q
I X=998 D Q
.I TOP="" D EN^DDIOL(" No PRIMARY SITE specified") K X Q
.I TOP>67149,TOP<67160 D EN^DDIOL(" Circumferential") Q
.I TOP>67159,TOP<67170 D EN^DDIOL(" Diffuse; widespread; 3/4s or more; linitis plastica") Q
.I TOP>67179,TOP<67210 D EN^DDIOL(" Familial/multiple polyposis") Q
.I TOP>67339,TOP<67350 D EN^DDIOL(" Diffuse, entire lung or NOS") Q
.I TOP>67499,TOP<67510 D EN^DDIOL(" Diffuse") Q
.D EN^DDIOL(" ")
.D EN^DDIOL(" Code 998 may only be used with the following sites:")
.D EN^DDIOL(" ")
.D EN^DDIOL(" Esophagus (C15.0-C15.9)")
.D EN^DDIOL(" Stomach (C16.0-C16.9)")
.D EN^DDIOL(" Colorectal (C18.0-C20.9)")
.D EN^DDIOL(" Lung (C34.0-C34.9)")
.D EN^DDIOL(" Breast (C50.0-C50.9)")
.D EN^DDIOL(" ")
.K X
I (X'?3N) K X Q
Q
;
TSCPSOT ;Tumor (165.5,29)
S TOP=$P($G(^ONCO(165.5,D0,2)),U,1)
I Y="000" S Y="No mass/tumor found" Q
I Y=990 S Y="Microscopic focus or foci only and no size of focus is given" Q
I Y=999 S Y="Unknown; size not stated; Not documented in patient record; Size of tumor cannot be assessed; NA" Q
I Y=989 S Y="989 mm or larger" Q
I Y=998 D Q
.I TOP="" S Y="" Q
.I TOP>67149,TOP<67160 S Y="Circumferential" Q
.I TOP>67159,TOP<67170 S Y="Diffuse; widespread; 3/4s or more; linitis plastica" Q
.I TOP>67179,TOP<67210 S Y="Familial/multiple polyposis" Q
.I TOP>67339,TOP<67350 S Y="Diffuse, entire lung or NOS" Q
.I TOP>67499,TOP<67510 S Y="Diffuse" Q
.S:Y'="" Y=Y_" mm"
S:Y'="" Y=Y_" mm"
Q
STMIT ;Size of Tumor (Melanoma) Item #23 1999 Melanoma PCE Study
I X'?1.3N K X Q
S X=+X
I X=998 D EN^DDIOL(" Mucosal melanoma") Q
I X=999 D EN^DDIOL(" Unknown; not recorded; NA")
Q
;
STMOT ;Size of Tumor (Melanoma) Item #23 1999 Melanoma PCE Study
I Y=998 S Y="Mucosal melanoma" Q
I Y=999 S Y="Unknown; not recorded; NA" Q
S Y=Y_" mm"
Q
;
;2000 Primary Intracranial/CNS Tumors PCE Study
TSIT ;Item 33. Tumor Size
I X'?1.3N K X Q
S X=+X
I X=999 D EN^DDIOL(" Unknown, cannot be determined, not recorded")
Q
TSOT ;Item 33. Tumor Size
I Y=999 S Y="Unknown, cannot be determined, not recorded" Q
S Y=Y_" mm"
Q
SRPTIT ;Item 46. Size of Residual Primary Tumor Following Cancer-Directed
;Surgery
I X'?1.3N K X Q
S X=+X
I X=0 D EN^DDIOL(" No residual tumor") Q
I X=995 D EN^DDIOL(" Size not specified, tumor judged smaller") Q
I X=996 D EN^DDIOL(" Size not specified, tumor judged unchanged") Q
I X=997 D EN^DDIOL(" Size not specified, tumor judged larger") Q
I X=998 D EN^DDIOL(" NA, surgical treatment not administered") Q
I X=999 D EN^DDIOL(" Unknown, tumor not evaluated")
Q
SRPTOT ;Item 46. Size of Residual Primary Tumor Following Cancer-Directed
;Surgery
I Y="000" S Y="No residual tumor" Q
I Y=995 S Y="Size not specified, tumor judged smaller" Q
I Y=996 S Y="Size not specified, tumor judged unchanged" Q
I Y=997 S Y="Size not specified, tumor judged larger" Q
I Y=998 S Y="NA, surgical treatment not administered" Q
I Y=999 S Y="Unknown, tumor not evaluated" Q
S Y=Y_" mm"
Q
;
SOC ;Sets of codes
Q:Y=""
S SOC=$P(^DD(FILNUM,FLDNUM,0),U,3),YY=Y_":"
S J=$F(SOC,YY),JJ=$F(SOC,";",J)-2,Y=Y_" "_$E(SOC,J,JJ)
K FILNUM,FLDNUM,J,JJ,SOC,YY
Q
;
TAHIST ;Screen for TOBACCO HISTORY (160,38) and ALCOHOL HISTORY (160,39)
S ACDT=0,NUM=0,ACY=$O(^ONCO(165.5,"AC",DA,""))
I ACY="" Q
S ACN=$E(ACY,1,4)
I (ACN>1998) S ACDT=1999
I Y?1N S NUM=1
Q
;
RE ;2001 Lung (NSCLC) Cancers PCE Study
; Item 9. Radiological Evaluation
; LNG TUMOR SIZE (BONE SCAN) (165.5,1409.4)
; LNG NUM OF TUMORS (BONE SCAN) (165.5,1409.5)
; LNG TUMOR SIZE (CHEST CT) (165.5,1410.4)
; LNG NUM OF TUMORS (CHEST CT) (165.5,1410.5)
; LNG TUMOR SIZE (BRAIN CT) (165.5,1411.4)
; LNG NUM OF TUMORS (BRAIN CT) (165.5,1411.5)
; LNG TUMOR SIZE (CHEST MRI) (165.5,1412.4)
; LNG NUM OF TUMORS (CHEST MRI) (165.5,1412.5)
; LNG TUMOR SIZE (BRAIN MRI) (165.5,1413.4)
; LNG NUM OF TUMORS (BRAIN MRI) (165.5,1413.5)
; LNG TUMOR SIZE (PET SCAN) (165.5,1414.4)
; LNG NUM OF TUMORS (PET SCAN) (165.5,1414.5)
; LNG TUMOR SIZE (CHEST XRAY) (165.5,1415.4)
; LNG NUM OF TUMORS (CHEST XRAY) (165.5,1415.5)
I +Y=0 S Y="Test not performed"
I Y=999!(Y=99) S Y="Test performed, not documented"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCOOT 11705 printed Dec 13, 2024@02:25:12 Page 2
ONCOOT ;HIRMFO/GWB - Miscellaneous Output Transforms ;7/10/96
+1 ;;2.2;ONCOLOGY;**1,6**;Jul 31, 2013;Build 10
+2 ;
RNE ;REGIONAL LYMPH NODES EXAMINED (165.5,33)
+1 SET DXDT=$PIECE($GET(^ONCO(165.5,D0,0)),U,16)
+2 IF DXDT<2980000
Begin DoDot:1
+3 IF Y=0
SET Y="No nodes were examined"
QUIT
+4 IF (+Y>0)&(+Y<97)
if $LENGTH(Y)=1
SET Y=0_Y
QUIT
+5 IF Y=97
SET Y="97 or more nodes examined"
QUIT
+6 IF Y=98
SET Y="Nodes examined, # not specified"
QUIT
+7 IF Y=99
SET Y="Unknown if nodes examined, NA"
QUIT
End DoDot:1
+8 IF DXDT>2971231
Begin DoDot:1
+9 IF Y=0
SET Y="No nodes examined"
QUIT
+10 IF (+Y>0)&(+Y<90)
if $LENGTH(Y)=1
SET Y=0_Y
QUIT
+11 IF Y=90
SET Y="90 or more nodes examined"
QUIT
+12 IF Y=95
SET Y="No nodes removed, aspiration performed"
QUIT
+13 IF Y=96
SET Y="Node removal as sampling, # unknown"
QUIT
+14 IF Y=97
SET Y="Node removal as dissection, # unknown"
QUIT
+15 IF Y=98
SET Y="Nodes surgically removed, # unknown"
QUIT
+16 IF Y=99
SET Y="Unknown, NA or -, not stated"
QUIT
End DoDot:1
+17 QUIT
+18 ;
RNP ;REGIONAL LYMPH NODES POSITIVE (165.5,32)
+1 IF Y=0
SET Y="All nodes examined are negative"
QUIT
+2 IF (+Y>0)&(+Y<90)
if $LENGTH(Y)=1
SET Y=0_Y
QUIT
+3 IF Y=90
SET Y="90 or more nodes are positive"
QUIT
+4 IF Y=95
SET Y="95 Positive aspiration was performed"
QUIT
+5 IF Y=97
SET Y="Positive nodes, # not specified"
QUIT
+6 IF Y=98
SET Y="No nodes were examined"
QUIT
+7 IF Y=99
SET Y="Unknown if nodes +, NA, not stated"
QUIT
+8 QUIT
+9 ;
BP ;BIOPSY PROCEDURE (165.5,141)
+1 if Y=""
QUIT
+2 DO BPGUCHK^ONCOTNE
+3 IF BPSITE=""
QUIT
+4 SET Y=$SELECT($PIECE($GET(^ONCO(164,BPSITE,"BP5",Y,0)),U,1)'="":$PIECE($GET(^ONCO(164,BPSITE,"BP5",Y,0)),U,1),1:Y)
+5 QUIT
+6 ;
+7 ;1998 Prostate Cancer Study
+8 ;
PSA ;PSA (165.5,684)
+1 IF Y=999.6
SET Y=Y_" or higher"
+2 IF Y=999.7
SET Y="No PSA test performed"
+3 IF Y=999.8
SET Y="Done, results unknown or not reported"
+4 IF Y=999.9
SET Y="Unknown if test performed"
+5 QUIT
+6 ;
DCISIT ;DCIS PRESENT (165.5,930) INPUT TRANSFORM
+1 IF X'?1N
KILL X
QUIT
+2 IF X=5!(X=6)!(X=7)
KILL X
QUIT
+3 IF X=0
DO EN^DDIOL(" No, DCIS not present")
+4 IF X=1
DO EN^DDIOL(" Yes, separate tumor")
+5 IF X=2
DO EN^DDIOL(" Yes, mixed histology component")
+6 IF X=3
DO EN^DDIOL(" Yes, separate tumor and mixed histology")
+7 IF X=4
DO EN^DDIOL(" Yes, unk if separate tumor/mixed histology")
+8 IF X=8
DO EN^DDIOL(" NA, reported tumor not invasive DC")
+9 IF X=9
DO EN^DDIOL(" Unknown if DCIS present")
+10 QUIT
DCISOT ;DCIS PRESENT (165.5,930) OUTPUT TRANSFORM
+1 IF Y=0
SET Y="No, DCIS not present"
+2 IF Y=1
SET Y="Yes, separate tumor"
+3 IF Y=2
SET Y="Yes, mixed histology component"
+4 IF Y=3
SET Y="Yes, separate tumor and mixed histology"
+5 IF Y=4
SET Y="Yes, unk if separate tumor/mixed histology"
+6 IF Y=8
SET Y="NA, reported tumor not invasive DC"
+7 IF Y=9
SET Y="Unknown if DCIS present"
+8 QUIT
DCISHP ;DCIS PRESENT (165.5,930) HELP
+1 DO EN^DDIOL(" Choose from:")
+2 DO EN^DDIOL(" 0 No, DCIS not present")
+3 DO EN^DDIOL(" 1 Yes, separate tumor")
+4 DO EN^DDIOL(" 2 Yes, mixed histology component")
+5 DO EN^DDIOL(" 3 Yes, separate tumor and mixed histology")
+6 DO EN^DDIOL(" 4 Yes, unk if separate tumor/mixed histology")
+7 DO EN^DDIOL(" 8 NA, reported tumor not invasive DC")
+8 DO EN^DDIOL(" 9 Unknown if DCIS present")
+9 QUIT
DCSZIT ;
+1 IF +X=0
DO EN^DDIOL(" Invasive DC reported, DCIS not present")
+2 IF X="888"
DO EN^DDIOL(" NA, invasive DC not reported")
+3 IF X="988"
DO EN^DDIOL(" Invasive DC reported, DCIS present, size unknown")
+4 IF X="999"
DO EN^DDIOL(" Invasive DC reported, unknown if DCIS present")
+5 QUIT
DCSZOT ;
+1 SET Y=$SELECT($LENGTH(Y)=1:"00"_Y,$LENGTH(Y)=2:"0"_Y,1:Y)
+2 IF Y="000"
SET Y="Invasive DC reported, DCIS not present"
+3 IF Y="888"
SET Y="NA, invasive DC not reported"
+4 IF Y="988"
SET Y="Invasive DC reported, DCIS present, size unknown"
+5 IF Y="999"
SET Y="Invasive DC reported, unknown if DCIS present"
+6 QUIT
CGYIT ;
+1 IF +X=0
DO EN^DDIOL(" No radiation given")
+2 IF X=88888
DO EN^DDIOL(" Radiation given, dose unknown")
+3 IF X=99999
DO EN^DDIOL(" Unknown if radiation given")
+4 QUIT
CGYOT ;
+1 SET Y=$SELECT($LENGTH(Y)=1:"0000"_Y,$LENGTH(Y)=2:"000"_Y,$LENGTH(Y)=3:"00"_Y,$LENGTH(Y)=4:"0"_Y,1:Y)
+2 IF Y="00000"
SET Y="No radiation given"
+3 IF Y=88888
SET Y="Radiation given, dose unknown"
+4 IF Y=99999
SET Y="Unknown if radiation given"
+5 QUIT
STIT ;Tumor Size (165.5,29)
+1 SET TOP=$PIECE($GET(^ONCO(165.5,D0,2)),U,1)
+2 IF '$DATA(X)
QUIT
+3 IF (X>999)!(X<0)
KILL X
QUIT
+4 IF X="000"
DO EN^DDIOL(" No mass or tumor found")
QUIT
+5 IF X=990
DO EN^DDIOL(" Microscopic focus, no size given")
QUIT
+6 IF X=999
DO EN^DDIOL(" Unknown; not stated; NA")
QUIT
+7 IF $$MELANOMA^ONCOU55(D0)
IF TOP'=67691
IF TOP'=67692
IF TOP'=67693
IF TOP'=67694
IF TOP'=67698
IF TOP'=67699
Begin DoDot:1
+8 IF X=989
DO EN^DDIOL(" Melanoma > or = 9.89 mm in depth")
QUIT
+9 IF X>9.89
DO EN^DDIOL(" Use code 989 for melanomas > 9.89 mm in depth")
KILL X
QUIT
+10 ; 1 -> 100
IF X?1N
SET X=X_"00"
QUIT
+11 ; .1 -> 010
IF X?1P1N
SET X="0"_$PIECE(X,".",2)_"0"
QUIT
+12 ; .01 -> 001
IF X?1P2N
SET X="0"_$PIECE(X,".",2)
QUIT
+13 ; 0.1 -> 010
IF X?1N1P1N
SET X=$PIECE(X,".",1)_$PIECE(X,".",2)_0
QUIT
+14 ; 0.01 -> 001
IF X?1N1P2N
SET X=$PIECE(X,".",1)_$PIECE(X,".",2)
QUIT
+15 ;0.012
IF X?1N1P3N
DO EN^DDIOL(" Too many decimal places")
KILL X
QUIT
+16 KILL X
End DoDot:1
QUIT
+17 IF X=989
DO EN^DDIOL(" 989 mm or larger")
QUIT
+18 IF X["."
DO EN^DDIOL(" No decimal point allowed")
KILL X
QUIT
+19 IF X=998
Begin DoDot:1
+20 IF TOP=""
DO EN^DDIOL(" No PRIMARY SITE specified")
KILL X
QUIT
+21 IF TOP>67149
IF TOP<67160
DO EN^DDIOL(" Entire circumference")
QUIT
+22 IF TOP>67159
IF TOP<67170
DO EN^DDIOL(" Diffuse; widespread; linitis plastica")
QUIT
+23 IF TOP>67179
IF TOP<67210
DO EN^DDIOL(" Familial/multiple polyposis")
QUIT
+24 IF TOP>67339
IF TOP<67350
DO EN^DDIOL(" Diffuse, entire lobe of lung")
QUIT
+25 IF TOP>67499
IF TOP<67510
DO EN^DDIOL(" Diffuse; widespread; inflam carcinoma")
QUIT
+26 DO EN^DDIOL(" ")
+27 DO EN^DDIOL(" Code 998 may only be used with the following sites:")
+28 DO EN^DDIOL(" ")
+29 DO EN^DDIOL(" Esophagus (C15.0-C15.9)")
+30 DO EN^DDIOL(" Stomach (C16.0-C16.9)")
+31 DO EN^DDIOL(" Colorectal (C18.0-C20.9)")
+32 DO EN^DDIOL(" Lung (C34.0-C34.9)")
+33 DO EN^DDIOL(" Breast (C50.0-C50.9)")
+34 DO EN^DDIOL(" ")
+35 KILL X
End DoDot:1
QUIT
+36 SET X=$SELECT($LENGTH(X)=1:"00"_X,$LENGTH(X)=2:"0"_X,1:X)
+37 IF X'?3N
KILL X
QUIT
+38 IF (X=991)!(X=992)!(X=993)!(X=994)!(X=995)!(X=996)!(X=997)
KILL X
+39 QUIT
+40 ;
STOT ;Size of Tumor (165.5,29)
+1 SET TOP=$PIECE($GET(^ONCO(165.5,D0,2)),U,1)
+2 IF Y="000"
SET Y="No mass or tumor found"
QUIT
+3 IF Y=990
SET Y="Microscopic focus, no size given"
QUIT
+4 IF Y=999
SET Y="Unknown; not stated; NA"
QUIT
+5 IF $$MELANOMA^ONCOU55(D0)
IF TOP'=67691
IF TOP'=67692
IF TOP'=67693
IF TOP'=67694
IF TOP'=67698
IF TOP'=67699
IF Y=989
Begin DoDot:1
+6 SET Y="Melanoma > or = 9.89 mm in depth"
End DoDot:1
QUIT
+7 IF $$MELANOMA^ONCOU55(D0)
IF TOP'=67691
IF TOP'=67692
IF TOP'=67693
IF TOP'=67694
IF TOP'=67698
IF TOP'=67699
IF Y'=""
Begin DoDot:1
+8 SET Y=$EXTRACT(Y,1)_"."_$EXTRACT(Y,2,3)
End DoDot:1
+9 IF Y=989
SET Y="989 mm or larger"
QUIT
+10 IF Y=998
Begin DoDot:1
+11 IF TOP=""
SET Y=""
QUIT
+12 IF TOP>67149
IF TOP<67160
SET Y="Entire circumference"
QUIT
+13 IF TOP>67159
IF TOP<67170
SET Y="Diffuse; widespread; linitis plastica"
QUIT
+14 IF TOP>67179
IF TOP<67210
SET Y="Familial/multiple polyposis"
QUIT
+15 IF TOP>67339
IF TOP<67350
SET Y="Diffuse, entire lobe of lung"
QUIT
+16 IF TOP>67499
IF TOP<67510
SET Y="Diffuse; widespread; inflam carcinoma"
QUIT
+17 if Y'=""
SET Y=Y_" mm"
End DoDot:1
QUIT
+18 if Y'=""
SET Y=Y_" mm"
+19 QUIT
+20 ;
TSCPSIT ;Tumor Size Clinical/Pathologic/Summary (165.5,29.3;29.4;29.5)
+1 SET TOP=$PIECE($GET(^ONCO(165.5,D0,2)),U,1)
+2 IF '$DATA(X)
QUIT
+3 IF (X>999)!(X<0)!(X=991)!(X=992)!(X=993)!(X=994)!(X=995)!(X=996)!(X=997)
KILL X
QUIT
+4 SET X=$SELECT($LENGTH(X)=1:"00"_X,$LENGTH(X)=2:"0"_X,1:X)
+5 IF X="000"
DO EN^DDIOL(" No mass/tumor found")
QUIT
+6 IF X=990
DO EN^DDIOL(" Microscopic focus or foci only and no size of focus is given")
QUIT
+7 IF X=999
DO EN^DDIOL(" Unknown; size not stated; Not documented in patient record; Size of tumor cannot be assessed; NA")
QUIT
+8 IF X=989
DO EN^DDIOL(" 989 mm or larger")
QUIT
+9 IF X=998
Begin DoDot:1
+10 IF TOP=""
DO EN^DDIOL(" No PRIMARY SITE specified")
KILL X
QUIT
+11 IF TOP>67149
IF TOP<67160
DO EN^DDIOL(" Circumferential")
QUIT
+12 IF TOP>67159
IF TOP<67170
DO EN^DDIOL(" Diffuse; widespread; 3/4s or more; linitis plastica")
QUIT
+13 IF TOP>67179
IF TOP<67210
DO EN^DDIOL(" Familial/multiple polyposis")
QUIT
+14 IF TOP>67339
IF TOP<67350
DO EN^DDIOL(" Diffuse, entire lung or NOS")
QUIT
+15 IF TOP>67499
IF TOP<67510
DO EN^DDIOL(" Diffuse")
QUIT
+16 DO EN^DDIOL(" ")
+17 DO EN^DDIOL(" Code 998 may only be used with the following sites:")
+18 DO EN^DDIOL(" ")
+19 DO EN^DDIOL(" Esophagus (C15.0-C15.9)")
+20 DO EN^DDIOL(" Stomach (C16.0-C16.9)")
+21 DO EN^DDIOL(" Colorectal (C18.0-C20.9)")
+22 DO EN^DDIOL(" Lung (C34.0-C34.9)")
+23 DO EN^DDIOL(" Breast (C50.0-C50.9)")
+24 DO EN^DDIOL(" ")
+25 KILL X
End DoDot:1
QUIT
+26 IF (X'?3N)
KILL X
QUIT
+27 QUIT
+28 ;
TSCPSOT ;Tumor (165.5,29)
+1 SET TOP=$PIECE($GET(^ONCO(165.5,D0,2)),U,1)
+2 IF Y="000"
SET Y="No mass/tumor found"
QUIT
+3 IF Y=990
SET Y="Microscopic focus or foci only and no size of focus is given"
QUIT
+4 IF Y=999
SET Y="Unknown; size not stated; Not documented in patient record; Size of tumor cannot be assessed; NA"
QUIT
+5 IF Y=989
SET Y="989 mm or larger"
QUIT
+6 IF Y=998
Begin DoDot:1
+7 IF TOP=""
SET Y=""
QUIT
+8 IF TOP>67149
IF TOP<67160
SET Y="Circumferential"
QUIT
+9 IF TOP>67159
IF TOP<67170
SET Y="Diffuse; widespread; 3/4s or more; linitis plastica"
QUIT
+10 IF TOP>67179
IF TOP<67210
SET Y="Familial/multiple polyposis"
QUIT
+11 IF TOP>67339
IF TOP<67350
SET Y="Diffuse, entire lung or NOS"
QUIT
+12 IF TOP>67499
IF TOP<67510
SET Y="Diffuse"
QUIT
+13 if Y'=""
SET Y=Y_" mm"
End DoDot:1
QUIT
+14 if Y'=""
SET Y=Y_" mm"
+15 QUIT
STMIT ;Size of Tumor (Melanoma) Item #23 1999 Melanoma PCE Study
+1 IF X'?1.3N
KILL X
QUIT
+2 SET X=+X
+3 IF X=998
DO EN^DDIOL(" Mucosal melanoma")
QUIT
+4 IF X=999
DO EN^DDIOL(" Unknown; not recorded; NA")
+5 QUIT
+6 ;
STMOT ;Size of Tumor (Melanoma) Item #23 1999 Melanoma PCE Study
+1 IF Y=998
SET Y="Mucosal melanoma"
QUIT
+2 IF Y=999
SET Y="Unknown; not recorded; NA"
QUIT
+3 SET Y=Y_" mm"
+4 QUIT
+5 ;
+6 ;2000 Primary Intracranial/CNS Tumors PCE Study
TSIT ;Item 33. Tumor Size
+1 IF X'?1.3N
KILL X
QUIT
+2 SET X=+X
+3 IF X=999
DO EN^DDIOL(" Unknown, cannot be determined, not recorded")
+4 QUIT
TSOT ;Item 33. Tumor Size
+1 IF Y=999
SET Y="Unknown, cannot be determined, not recorded"
QUIT
+2 SET Y=Y_" mm"
+3 QUIT
SRPTIT ;Item 46. Size of Residual Primary Tumor Following Cancer-Directed
+1 ;Surgery
+2 IF X'?1.3N
KILL X
QUIT
+3 SET X=+X
+4 IF X=0
DO EN^DDIOL(" No residual tumor")
QUIT
+5 IF X=995
DO EN^DDIOL(" Size not specified, tumor judged smaller")
QUIT
+6 IF X=996
DO EN^DDIOL(" Size not specified, tumor judged unchanged")
QUIT
+7 IF X=997
DO EN^DDIOL(" Size not specified, tumor judged larger")
QUIT
+8 IF X=998
DO EN^DDIOL(" NA, surgical treatment not administered")
QUIT
+9 IF X=999
DO EN^DDIOL(" Unknown, tumor not evaluated")
+10 QUIT
SRPTOT ;Item 46. Size of Residual Primary Tumor Following Cancer-Directed
+1 ;Surgery
+2 IF Y="000"
SET Y="No residual tumor"
QUIT
+3 IF Y=995
SET Y="Size not specified, tumor judged smaller"
QUIT
+4 IF Y=996
SET Y="Size not specified, tumor judged unchanged"
QUIT
+5 IF Y=997
SET Y="Size not specified, tumor judged larger"
QUIT
+6 IF Y=998
SET Y="NA, surgical treatment not administered"
QUIT
+7 IF Y=999
SET Y="Unknown, tumor not evaluated"
QUIT
+8 SET Y=Y_" mm"
+9 QUIT
+10 ;
SOC ;Sets of codes
+1 if Y=""
QUIT
+2 SET SOC=$PIECE(^DD(FILNUM,FLDNUM,0),U,3)
SET YY=Y_":"
+3 SET J=$FIND(SOC,YY)
SET JJ=$FIND(SOC,";",J)-2
SET Y=Y_" "_$EXTRACT(SOC,J,JJ)
+4 KILL FILNUM,FLDNUM,J,JJ,SOC,YY
+5 QUIT
+6 ;
TAHIST ;Screen for TOBACCO HISTORY (160,38) and ALCOHOL HISTORY (160,39)
+1 SET ACDT=0
SET NUM=0
SET ACY=$ORDER(^ONCO(165.5,"AC",DA,""))
+2 IF ACY=""
QUIT
+3 SET ACN=$EXTRACT(ACY,1,4)
+4 IF (ACN>1998)
SET ACDT=1999
+5 IF Y?1N
SET NUM=1
+6 QUIT
+7 ;
RE ;2001 Lung (NSCLC) Cancers PCE Study
+1 ; Item 9. Radiological Evaluation
+2 ; LNG TUMOR SIZE (BONE SCAN) (165.5,1409.4)
+3 ; LNG NUM OF TUMORS (BONE SCAN) (165.5,1409.5)
+4 ; LNG TUMOR SIZE (CHEST CT) (165.5,1410.4)
+5 ; LNG NUM OF TUMORS (CHEST CT) (165.5,1410.5)
+6 ; LNG TUMOR SIZE (BRAIN CT) (165.5,1411.4)
+7 ; LNG NUM OF TUMORS (BRAIN CT) (165.5,1411.5)
+8 ; LNG TUMOR SIZE (CHEST MRI) (165.5,1412.4)
+9 ; LNG NUM OF TUMORS (CHEST MRI) (165.5,1412.5)
+10 ; LNG TUMOR SIZE (BRAIN MRI) (165.5,1413.4)
+11 ; LNG NUM OF TUMORS (BRAIN MRI) (165.5,1413.5)
+12 ; LNG TUMOR SIZE (PET SCAN) (165.5,1414.4)
+13 ; LNG NUM OF TUMORS (PET SCAN) (165.5,1414.5)
+14 ; LNG TUMOR SIZE (CHEST XRAY) (165.5,1415.4)
+15 ; LNG NUM OF TUMORS (CHEST XRAY) (165.5,1415.5)
+16 IF +Y=0
SET Y="Test not performed"
+17 IF Y=999!(Y=99)
SET Y="Test performed, not documented"
+18 QUIT