Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ONCOTNM

ONCOTNM.m

Go to the documentation of this file.
  1. ONCOTNM ;Hines OIFO/GWB - TNM coding ;02/22/11
  1. ;;2.2;ONCOLOGY;**1,6**;Jul 31, 2013;Build 10
  1. ;
  1. ;INPUT TRANSFORM, OUTPUT TRANSFORM and HELP for:
  1. ;CLINICAL T (165.5,37.1)
  1. ;CLINICAL N (165.5,37.2)
  1. ;CLINICAL M (165.5,37.3)
  1. ;PATHOLOGIC T (165.5,85)
  1. ;PATHOLOGIC N (165.5,86)
  1. ;PATHOLOGIC M (165.5,87)
  1. ;OTHER T (165.5,93)
  1. ;OTHER N (165.5,98)
  1. ;OTHER M (165.5,99)
  1. ;
  1. IN ;INPUT TRANSFORM
  1. D INPUT^ONCOTNM2 Q ;replace all existing IT - NAACCR Vol II V16
  1. D SETVAR
  1. G EX:(ST="")!(TX="")
  1. S X=$TR(X,"abcdilmopsuvx","ABCDILMOPSUVX")
  1. I (X="X")!(X="IS")!(X="A") G IN1
  1. S XX=$E(X)
  1. S X=$S(XX?1.A:$E(X,2,$L(X)),1:X) I X="" K X G EX
  1. IN1 S TRANSFRM="INPUT" D FILSC
  1. I $D(^ONCO(FIL,SC,ONCOX_ONCOED)) S ONCOX=ONCOX_ONCOED G CKIN
  1. I $D(^ONCO(FIL,SC,ONCOX_(ONCOED-1))) S ONCOX=ONCOX_(ONCOED-1) G CKIN
  1. I $D(^ONCO(FIL,SC,ONCOX_(ONCOED-2))) S ONCOX=ONCOX_(ONCOED-2)
  1. CKIN D CK I 'XD0 S X=$TR(X,"abcd","ABCD") D CK
  1. I 'XD0 K X
  1. E D
  1. .S TD=$P(^ONCO(FIL,SC,ONCOX,XD0,0),U,1)
  1. .I ONCOX["T" S T=$S(TD="CBA":"Primary tumor cannot be assessed",TD="NET":"No evidence of primary tumor",TD="CIS":"Carcinoma 'in situ'",TD="TIAS":"Tumor invades adjacent structures",TD="TIAO":"Tumor invades adjacent organs",1:TD)
  1. .I ONCOX["N" S T=$S(TD="NCA":"Regional lymph nodes cannot be assessed",TD="NRN":"No regional lymph node metastasis",TD="MET":"Metastasis in regional lymph node(s)",1:TD)
  1. .I ONCOX["M" S T=TD
  1. I ONCOED>6,STGIND="P",ONCOX["M",$G(X)'[1 K X
  1. D EX
  1. Q
  1. ;
  1. CK ;Check for existence of code
  1. S XD0=$G(^ONCO(FIL,SC,ONCOX,"X",X))
  1. Q
  1. ;
  1. OT ;OUTPUT TRANSFORM
  1. D SETVAR
  1. G EX:(ST="")!(TX="")
  1. D @$S(ONCOED<3:"OT12",1:"OT3456")
  1. Q
  1. ;
  1. OT12 ;1st and 2nd editions
  1. S:Y'="" Y=$E(ONCOX)_Y
  1. Q
  1. ;
  1. OT3456 ;3rd, 4th, 5th, 6th and 7th editions
  1. S TRANSFRM="OUTPUT" D FILSC
  1. I Y="" G EX
  1. I $D(^ONCO(FIL,SC,ONCOX_ONCOED)) S ONCOX=ONCOX_ONCOED G CKOT
  1. I $D(^ONCO(FIL,SC,ONCOX_(ONCOED-1))) S ONCOX=ONCOX_(ONCOED-1) G CKOT
  1. I $D(^ONCO(FIL,SC,ONCOX_(ONCOED-2))) S ONCOX=ONCOX_(ONCOED-2)
  1. CKOT S XD0=$G(^ONCO(FIL,SC,ONCOX,"X",Y)) G EX:XD0=""
  1. S TC=^ONCO(FIL,SC,ONCOX,XD0,0),MM=""
  1. D TC
  1. I ONCOED<7 S Y=$E(ONCOX)_$P(TC,U,2)_MM_" "_TT G OTEX
  1. I (ONCOED=7)&($E(ONCOX)="M") S Y=$E(ONCOX)_Y(0)_MM G OTEX
  1. I ONCOED=7 S Y=$E(ONCOX)_Y(0)_MM
  1. ;I (ONCOED=7)&($E(ONCOX)="M") S Y=$E(ONCOX)_$P(TC,U,2)_MM G OTEX
  1. ;I ONCOED=7 S Y=$E(ONCOX)_$P(TC,U,1)_MM
  1. OTEX S YSTRING=$E(Y,2,99)
  1. S YSTRING=$TR(YSTRING,"ABCDEIMOLSUX","abcdeimolsux")
  1. S Y=$E(Y,1)_YSTRING
  1. G EX
  1. ;
  1. TC I $E(ONCOX)="T" D
  1. .S TT=$S(Y="X":"Primary tumor cannot be assessed",Y=0:"No evidence of primary tumor",1:$P(TC,U))
  1. .S TT=$S(TT="TIAS":"Tumor invades adjacent structures",1:TT)
  1. .N MC,MM,MT,XXDTDX
  1. .S MT=$P($G(^ONCO(165.5,D0,2)),U,31) ;MULTIPLE TUMORS (165.5,69)
  1. .S MC=$P($G(^ONCO(165.5,D0,24)),U,16) ;MULTIPLICITY COUNTER (165.5,196)
  1. .S XXDTDX=$P($G(^ONCO(165.5,D0,0)),U,16)
  1. .I XXDTDX<3070000 S MM=MT
  1. .I XXDTDX>3069999 S MM=MC I (+MM=0)!(+MM=1)!(MM>87) S MM=""
  1. .I MM'="" S MM=$S(+MM>1:"m"_+MM,1:"m")
  1. E I $E(ONCOX)="N" S TT=$S($P(TC,U,1)="NCA":"Regional lymph nodes cannot be assessed",$P(TC,U,1)="NRN":"No regional lymph node metastasis",ST=58:"NA",1:$P(TC,U)),TT=$S(TT="MET":"Metastasis in regional lymph node(s)",1:TT)
  1. E I $E(ONCOX)="M" S TT=$P(TC,U) Q
  1. Q
  1. ;
  1. HP ;HELP
  1. D HELP^ONCOTNM2 Q ;replace all existing HELP - NAACCR Vol II V16
  1. D SETVAR
  1. G EX:(ST="")!(TX="")
  1. D @$S(ONCOED<3:"P12",1:"P3456")
  1. Q
  1. ;
  1. P12 ;1st and 2nd edition
  1. D EN^DDIOL("Enter the appropriate TNM code.",,"!!")
  1. Q
  1. ;
  1. P3456 ;3rd, 4th, 5th, 6th and 7th editions
  1. S TRANSFRM="HELP" D FILSC
  1. I $D(^ONCO(FIL,SC,ONCOX_ONCOED)) S ONCOX=ONCOX_ONCOED
  1. ;
  1. ;Full text help from AJCC STAGING GROUPS (164.33)
  1. N S,SUB
  1. S S=SC
  1. I ONCOED>6,FIL=164.33,(S=31)!(S=25)!(S=39)!(S=41)!(S=50)!(S=51)!(S=55)!(S=56)!(S=57)!(S=58)!(S=59)!(S=60)!(S=61)!(S=62)!(S=63)!(S=64)!(S=66) S SUB=$S($E(ONCOX,1)="T":7,$E(ONCOX,1)="N":8,1:9) I $D(^ONCO(164.33,S,SUB)) D D EN^DDIOL(" ") Q
  1. .S HIEN=0 F S HIEN=$O(^ONCO(164.33,SC,SUB,HIEN)) Q:HIEN'>0 D
  1. ..I STGIND="P",ONCOX["M",(^ONCO(164.33,SC,SUB,HIEN,0)'["M1")&(^ONCO(164.33,SC,SUB,HIEN,0)'="Distant Metastasis (M)")&(^ONCO(164.33,SC,SUB,HIEN,0)'="")&(^ONCO(164.33,SC,SUB,HIEN,0)'=" ") Q
  1. ..D EN^DDIOL(^ONCO(164.33,SC,SUB,HIEN,0),,"!?1")
  1. ;
  1. I ONCOED>5,FIL=164.33,(SC=22)!(SC=23)!(SC=25)!(SC=29)!(SC=30)!(SC=35)!(SC=39)!(SC=41)!(SC=50)!(SC=51)!(SC=55)!(SC=61)!(SC=62)!(SC=63) S SUB=$S($E(ONCOX,1)="T":4,$E(ONCOX,1)="N":5,1:6) I $D(^ONCO(164.33,SC,SUB)) D D EN^DDIOL(" ") K SUB Q
  1. .S HIEN=0 F S HIEN=$O(^ONCO(164.33,SC,SUB,HIEN)) Q:HIEN'>0 D
  1. ..I ONCOED>6,STGIND="P",ONCOX["M",(^ONCO(164.33,SC,SUB,HIEN,0)'["M1")&(^ONCO(164.33,SC,SUB,HIEN,0)'="Distant Metastasis (M)")&(^ONCO(164.33,SC,SUB,HIEN,0)'="") Q
  1. ..D EN^DDIOL(^ONCO(164.33,SC,SUB,HIEN,0),,"!?1")
  1. ;
  1. I ONCOED>4,ONCOED<7,FIL=164.33,(SC=22)!(SC=23)!(SC=25)!(SC=29)!(SC=30)!(SC=35)!(SC=39)!(SC=41)!(SC=50)!(SC=51) S SUB=$S($E(ONCOX,1)="T":1,$E(ONCOX,1)="N":2,1:3) I $D(^ONCO(164.33,SC,SUB)) D D EN^DDIOL(" ") K SUB Q
  1. .S HIEN=0 F S HIEN=$O(^ONCO(164.33,SC,SUB,HIEN)) Q:HIEN'>0 D EN^DDIOL(^ONCO(164.33,SC,SUB,HIEN,0),,"!?1")
  1. ;
  1. ;Full text help from ICDO TOPOGRAPHY (164)
  1. I ONCOED>6 S SUB=$S($E(ONCOX,1)="T":11,$E(ONCOX,1)="N":12,1:13) I $D(^ONCO(164,SC,SUB)) D D EN^DDIOL(" ") K SUB Q
  1. .S HIEN=0 F S HIEN=$O(^ONCO(164,SC,SUB,HIEN)) Q:HIEN'>0 D
  1. ..I ONCOED>6,STGIND="P",SUB=13,(^ONCO(164,SC,SUB,HIEN,0)["M0")!(^ONCO(164,SC,SUB,HIEN,0)["MX") D Q
  1. ...I SC=67500 S HIEN=HIEN+5 Q
  1. ..D EN^DDIOL(^ONCO(164,SC,SUB,HIEN,0),,"!?1")
  1. ;
  1. I ONCOED>5 S SUB=$S($E(ONCOX,1)="T":8,$E(ONCOX,1)="N":9,1:10) I $D(^ONCO(164,SC,SUB)) D D EN^DDIOL(" ") K SUB Q
  1. .S HIEN=0 F S HIEN=$O(^ONCO(164,SC,SUB,HIEN)) Q:HIEN'>0 D EN^DDIOL(^ONCO(164,SC,SUB,HIEN,0),,"!?1")
  1. ;
  1. I ONCOED>4 S SUB=$S($E(ONCOX,1)="T":5,$E(ONCOX,1)="N":6,1:7) I $D(^ONCO(164,SC,SUB)) D D EN^DDIOL(" ") K SUB Q
  1. .S HIEN=0 F S HIEN=$O(^ONCO(164,SC,SUB,HIEN)) Q:HIEN'>0 D EN^DDIOL(^ONCO(164,SC,SUB,HIEN,0),,"!?1")
  1. ;
  1. S XD0=0
  1. D EN^DDIOL($S(ONCOX["T":" Primary Tumor (T)",ONCOX["N":" Regional Lymph Nodes (N)",ONCOX["M":" Distant Metastasis (M)",1:""))
  1. D EN^DDIOL(" ")
  1. F S XD0=$O(^ONCO(FIL,SC,ONCOX,XD0)) Q:XD0'>0 D
  1. .N Y,T
  1. .S Y=^(XD0,0),T=$P(Y,U)
  1. .I ONCOX["T" D
  1. ..I $P(Y,U,2)'=88 D EN^DDIOL("T"_$P(Y,U,2),,"!?1")
  1. ..D EN^DDIOL($S(T="CBA":"Primary tumor cannot be assessed",T="NET":"No evidence of primary tumor",T="CIS":"Carcinoma 'in situ'",T="TIAS":"Tumor invades adjacent structures",T="TIAO":"Tumor invades adjacent organs",1:T),,"?12")
  1. .E I ONCOX["N" I $P(Y,U,2)'=88 D EN^DDIOL("N"_$P(Y,U,2),,"!?1") D EN^DDIOL($S(T="NCA":"Regional lymph nodes cannot be assessed",T="NRN":"No regional lymph node metastasis",T="MET":"Regional lymph nodes metastasis",1:T),,"?13")
  1. .E I ONCOX["M" D
  1. ..I ONCOED>6,STGIND="P",($P(Y,U,2)="X")!($P(Y,U,2)=0) Q
  1. ..I $P(Y,U,2)'=88 D EN^DDIOL("M"_$P(Y,U,2),,"!?1") D EN^DDIOL(T,,"?6")
  1. D EN^DDIOL(" ") Q
  1. ;
  1. SETVAR ;Set variables
  1. S ST=$P(^ONCO(165.5,D0,0),U,1) ;SITE/GP
  1. S TX=$P($G(^ONCO(165.5,D0,2)),U,1) ;PRIMARY SITE
  1. Q:TX=""
  1. S HT=$$HIST^ONCFUNC(D0) ;Histology
  1. S HT14=$E(HT,1,4)
  1. S SC=$P(^ONCO(164,TX,0),U,11) ;T & N CODES
  1. S DATEDX=$P(^ONCO(165.5,D0,0),U,16) ;DATE DX
  1. S YR=$E($P($G(^ONCO(165.5,D0,0)),U,16),1,3) ;DATE DX (Year)
  1. S ONCOED=$S(YR<283:1,YR<288:2,YR<292:3,YR<298:4,YR<303:5,YR<310:6,1:7)
  1. S SD=$P($G(^ONCO(165.5,D0,"CS3")),U,1) ;SCHEMA DISCRIMINATOR
  1. S FIL=164
  1. Q
  1. ;
  1. FILSC ;Get file (FIL) and IEN (SC) for appropriate TNM list
  1. ;
  1. ;PART II: HEAD AND NECK
  1. ;Mucosal Melanoma of the Head and Neck
  1. N TC
  1. S TC=$E(TX,3,4)
  1. I ONCOED>6,(HT>87199)&(HT<87910),((TC="00")!(TC="01")!(TC="02")!(TC="03")!(TC="04")!(TC="05")!(TC="06")!(TC="09")!(TC=10)!(TC=11)!(TC=12)!(TC=13)!(TC=32)!(TX=67300)!(TX=67310)!(TX=67311)!(TX=67140)!(TX=67142)!(TX=67148)) S FIL=164.33,SC=61 Q
  1. ;
  1. ;PART III: DIGESTIVE SYSTEM
  1. ;Esophagus and Esophagastric Junction
  1. I ONCOED>4,ONCOED<7,TX=67151,ONCOX="M" S FIL=164,SC=67154 Q
  1. I ONCOED>4,ONCOED<7,TX=67152,ONCOX="M" S FIL=164,SC=67155 Q
  1. I ONCOED>4,ONCOED<7,TX=67153,ONCOX="M" S FIL=164,SC=67153 Q
  1. I ONCOED>4,ONCOED<7,TX=67154,ONCOX="M" S FIL=164,SC=67154 Q
  1. I ONCOED>4,ONCOED<7,TX=67155,ONCOX="M" S FIL=164,SC=67155 Q
  1. I ONCOED>6,(TX=67161)!(TX=67162),(SD="010")!(SD="020")!(SD="040")!(SD="060") S FIL=164,SC=67150 Q
  1. I ONCOED>6,TX=67160,((HT14>7999)&(HT14<8153)!(HT14>8153)&(HT14<8232)!(HT14>8242)&(HT14<8246)!(HT14>8249)&(HT14<8577)!(HT14>8939)&(HT14<8951)!(HT14>8979)&(HT14<8982)) S FIL=164,SC=67150 Q
  1. ;
  1. ;Appendix, 7th Edition
  1. I ONCOED>6,TX=67181 D Q
  1. .I (HT14=8153)!(HT14=8240)!(HT14=8241)!(HT14=8242)!(HT14=8246)!(HT14=8249) S FIL=164.33,SC=62 Q
  1. .S FIL=164,SC=67181
  1. ;
  1. ;Gastrointestinal Stromal Tumor (GIST), 7th Edition
  1. I ($E(HT,1,4)=8935)!($E(HT,1,4)=8936),(($E(TX,3,4)=15)!($E(TX,3,4)=16)!($E(TX,3,4)=17)!($E(TX,3,4)=18)!($E(TX,3,4)=21)!($E(TX,3,4)=48)!(TX=67199)!(TX=67209)),ONCOED>6 S FIL=164.33,SC=56 Q
  1. ;
  1. ;Neuroendocrine Tumor (Stomach), 7th Edition
  1. I (($E(HT,1,4)=8153)!($E(HT,1,4)=8240)!($E(HT,1,4)=8241)!($E(HT,1,4)=8242)!($E(HT,1,4)=8246)!($E(HT,1,4)=8249)),$E(TX,3,4)=16,ONCOED>6 S FIL=164.33,SC=57 Q
  1. ;
  1. ;Neuroendocrine Tumor (Duodenum/Ampulla/Jejunum/Ileum), 7th Edition
  1. I (($E(HT,1,4)=8153)!($E(HT,1,4)=8240)!($E(HT,1,4)=8241)!($E(HT,1,4)=8242)!($E(HT,1,4)=8246)!($E(HT,1,4)=8249)),(($E(TX,3,4)=17)!(TX=67241)),ONCOED>6 S FIL=164.33,SC=58 Q
  1. ;
  1. ;Neuroendocrine Tumor (Colon or Rectum), 7th Edition
  1. I $$MELANOMA^ONCOU55(D0),(($E(TX,3,4)=44)!($E(TX,3,4)=51)!($E(TX,3,4)=60)!(TX=67632)) S FIL=164.33,SC=22 Q
  1. I (($E(HT,1,4)=8153)!($E(HT,1,4)=8240)!($E(HT,1,4)=8241)!($E(HT,1,4)=8242)!($E(HT,1,4)=8246)!($E(HT,1,4)=8249)),(($E(TX,3,4)=18)!(TX=67199)!(TX=67209)),ONCOED>6 S FIL=164.33,SC=59 Q
  1. ;
  1. ;Intrahepatic Bile Ducts
  1. I ONCOED>6,TX=67221 S FIL=164,SC=67221 Q
  1. ;
  1. ;Gallbladder
  1. I ONCOED>6,TX=67240,SD="030" S FIL=164,SC=67239 Q
  1. ;
  1. ;Extraheptic Bile Ducts
  1. I ((TX=67240)!(TX=67248)!(67249)),ONCOED=3,ONCOX="N" S FIL=164.33,SC=15 Q
  1. ;
  1. ;Perihilar Bile Duct
  1. ;I ONCOED>6,TX=67240,(SD="040")!(SD="070") S FIL=164.33,SC=63 Q
  1. ;
  1. ;Distal Bile Duct
  1. I ONCOED>6,TX=67240,(SD="040")!(SD="070") S FIL=164.33,SC=63 Q
  1. ;
  1. ;PART VI: SKIN
  1. ;Merkel Cell Carcinoma
  1. I ONCOED>6,$E(HT,1,4)=8247,((TX=67440)!(TX=67442)!(TX=67443)!(TX=67444)!(TX=67445)!(TX=67446)!(TX=67447)!(TX=67448)!(TX=67449)!($E(TX,3,4)=51)!($E(TX,3,4)=60)!(TX=67632)) S FIL=164.33,SC=60 Q
  1. ;
  1. ;Melanoma of the Skin
  1. I $$MELANOMA^ONCOU55(D0),(($E(TX,3,4)=44)!($E(TX,3,4)=51)!($E(TX,3,4)=60)!(TX=67632)) S FIL=164.33,SC=22 Q
  1. ;
  1. ;PART VII: BREAST
  1. ;Breast
  1. I $E(TX,1,4)=6750,ONCOX="N" D Q
  1. .I STGIND="C" Q
  1. .I STGIND="P" S FIL=164.33,SC=23
  1. ;
  1. ;PART VIII: GYNECOLOGIC SITES
  1. ;Vulva
  1. I ONCOED>4,$E(TX,3,4)=51,ONCOX="M" S FIL=164,SC=67518 Q
  1. ;
  1. ;Vagina - 3rd and 4th editions
  1. I TX=67529,ONCOX="N",ONCOED<5 D Q
  1. .S ONCUL=$P($G(^ONCO(165.5,D0,24)),U,4)
  1. .I ONCUL="U" Q
  1. .I ONCUL="L" S FIL=164.33,SC=52 Q
  1. ;
  1. ;Corpus Uteri - 7th edition
  1. I ONCOED>6,($E(TX,3,4)=54)!($E(TX,3,4)=55) D
  1. .I (HT14>7999)&(HT14<8791) S FIL=164,SC=67540 Q
  1. .I (HT14>8979)&(HT14<8982) S FIL=164,SC=67540 Q
  1. .I (HT14>9699)&(HT14<9702) S FIL=164,SC=67540 Q
  1. .I (HT14>8889)&(HT14<8899) S FIL=164.33,SC=25 Q
  1. .I (HT14>8929)&(HT14<8932) S FIL=164.33,SC=25 Q
  1. .I HT14=8933 S FIL=164.33,SC=64 Q
  1. ;
  1. ;Ovary and Primary Peritoneal Carcinoma - 7th edition
  1. I ONCOED>6,(TX=67481)!(TX=67482)!(TX=67488) D
  1. .I (HT14>7999)&(HT14<8577) S FIL=164,SC=67569 Q
  1. .I (HT14>8929)&(HT14<9111) S FIL=164,SC=67569 Q
  1. ;
  1. ;Gestational Trophoblastic Tumors - 5th, 6th and 7th editions
  1. ;I ONCOED>4,TX=67589,ONCOX="M" S FIL=164,SC=67540 Q
  1. I $$GTT^ONCOU55(D0),ONCOED>4,ONCOX="M" S FIL=164,SC=67589 Q
  1. ;I ONCOED=5,(($E(TX,3,4)=54)!($E(TX,3,4)=55)) S ONCOED=4
  1. ;
  1. ;PART IX: GENITOURINARY SITES
  1. ;Penis
  1. I $E(TX,3,4)=60,ONCOED>6,ONCOX="N",STGIND="C" S FIL=164.33,SC=31 Q
  1. I $E(TX,3,4)=60,ONCOED>6,ONCOX="N",STGIND="P" S FIL=164,SC=67600 Q
  1. ;
  1. ;Prostate
  1. I TX=67619,ONCOED>4,ONCOX="T",STGIND="P" S FIL=164.33,SC=29 Q
  1. I TX=67619,ONCOED=6,ONCOX="N",STGIND="P" S FIL=164.33,SC=29 Q
  1. I TX=67619,ONCOX="M" S FIL=164.33,SC=$S(ONCOED>3:29,1:3) Q
  1. ;
  1. ;Testis - 5th and 6th editions
  1. I $E(TX,3,4)=62,ONCOED>4,ONCOX="N",STGIND="P" S FIL=164.33,SC=30 Q
  1. I $E(TX,3,4)=62,ONCOED>4,ONCOX="M" S FIL=164,SC=67620 Q
  1. ;
  1. ;Urethra - Urothelial (Transitional Cell) Carcinoma of the Prostate
  1. I ONCOED>4,TX=67619,(HT=81203)!(HT=81303)!(HT=81223)!(HT=81202) D Q
  1. .I ONCOX="T" S FIL=164.33,SC=35
  1. .I ONCOX="N" S FIL=164,SC=67680
  1. .I ONCOX="M" S FIL=164.33,SC=3
  1. ;
  1. ;PART X: OPHTHALMIC SITES
  1. ;Malignant Melanoma of the Eyelid -3rd and 4th editions
  1. I TX=67441,ONCOED<5,$$MELANOMA^ONCOU55(D0) S FIL=164.33,SC=37 Q
  1. ;
  1. ;Malignant Melanoma of the Conjunctiva
  1. I $$MELANOMA^ONCOU55(D0),TX=67690 S FIL=164.33,SC=$S(STGIND="P":50,1:39) Q
  1. ;
  1. ;Malignant Melanoma of the Uvea
  1. I TX=67693 S FIL=164.33,SC=51 Q
  1. I TX=67694,($P($G(^ONCO(165.5,D0,2)),U,22)="C")!($P($G(^ONCO(165.5,D0,"CS3")),U,1)="010") S FIL=164.33,SC=51 Q
  1. ;
  1. ;Retinoblastoma
  1. I TX=67692,STGIND="P" S FIL=164.33,SC=41 Q
  1. ;
  1. ;Ocular Adnexal Lymphoma
  1. I ONCOED>6,(TX=67441)!(TX=67690)!(TX=67695)!(TX=67696) D
  1. .I (HT14>9589)&(HT14<9700) S FIL=164.33,SC=66 Q
  1. .I (HT14>9701)&(HT14<9739) S FIL=164.33,SC=66 Q
  1. .I (HT14>9810)&(HT14<9819) S FIL=164.33,SC=66 Q
  1. .I (HT14>9819)&(HT14<9838) S FIL=164.33,SC=66 Q
  1. ;
  1. ;PART XI: CENTRAL NERVOUS SYSTEM
  1. ;Brain - 3rd and 4th editions
  1. I ((TX=67700)!($E(TX,3,4)=71)),ONCOED<5 D
  1. .I ONCOX="T" S SC=$S($P($G(^ONCO(165.5,D0,2)),U,7)="I":67710,1:67700) Q
  1. .I TRANSFRM'="OUTPUT",ONCOX="N" D EN^DDIOL(" This category does not apply to this site.",,"?12")
  1. ;
  1. ;PART XII: LYMPHOID NEOPLASMS
  1. ;Mycosis fungoides and Sezary Disease of Skin, Vulva, Penis, Scrotum
  1. ;9700/3 and 9701/3
  1. ;C44.0-C44.9, C51.0-C51.2, C51.8-C51.9, C60.0-C60.2, C60.8-C60.9, C63.2
  1. I (HT=97003)!(HT=97013),($E(TX,3,4)=44)!($E(TX,3,4)=51)!($E(TX,3,4)=60)!(TX=67632),ONCOED>5 S FIL=164.33,SC=55 Q
  1. ;
  1. ;Bone metastasis
  1. I ONCOX="M",((HT14>8797)&(HT14<9137))!((HT14>9141)&(HT14<9583)) S FIL=164,SC=67400 Q
  1. ;
  1. I ONCOX="M",'$D(^ONCO(FIL,SC,"M"_ONCOED)) S FIL=164.33,SC=3
  1. ;
  1. Q
  1. ;
  1. EX ;Exit
  1. K FIL,HIEN,HT,HT14,MM,ONCOX,ONCUL,SC,SD,ST,TC,TD,TRANSFRM,TT,TX,XD0
  1. K XX,YR,YSTRING
  1. Q
  1. ;
  1. CLEANUP ;Cleanup
  1. K D0,DATEDX,ONCOED,STGIND