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

ONCSCHMC.m

Go to the documentation of this file.
ONCSCHMC ;HINES OIFO/RTK - Schema derivation, related code continued ;04/27/18
 ;;2.2;ONCOLOGY;**10,12,15,17,18**;Jul 31, 2013;Build 5
 ;
 ; go through until hit is found, else return ONCSCMA=0
 ;
 ;MEDULLABLASTOMA:
 ;https://staging.seer.cancer.gov/eod_public/schema/3.0/medulloblastoma_v9_2023/
 I ((ONCT3>699)&(ONCT3<730)) D  I ONCSCMA'=0 Q
 .I (HST14=9362)!((HST14>9469)&(HST14<9473))!((HST14>9473)&(HST14<9479))!((HST14>9500)&(HST14<9505))!(HST14=9508) S ONCSCMA="09724"
 I ((ONCT3>699)&(ONCT3<723))!((ONCT3>723)&(ONCT3<730)) D  I ONCSCMA'=0 Q
 .I (HST14=9473) S ONCSCMA="09724"
 I ONCTPCD="C753" D  I ONCSCMA'=0 Q
 .I (HST14=9362) S ONCSCMA="09724"
 ;
 ;MELANOMA CHOROID & CILIARY: C693 H8720-8790
 ;  or C694 H8720-8790 DISCRIM1=1
 I ONCTPCD="C693" D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00672"
 I ONCTPCD="C694" D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) D
 ..I ONCSDIS1=1 S ONCSCMA="00672"
 ;
 ;MELANOMA CONJUNCTIVA: C690 H8720-8790
 I ONCTPCD="C690" D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00660"
 ;
 ;MELANOMA HEAD & NECK: C003-C005,C008-C009,C019,C020-C024,C028-C029,
 ;  C030-C031,C039,C040-C041,C048-C049,C050-C052,C058-C059,C060-C062,
 ;  C090-C191,C098-C099,C100-C104,C108-C109,C110-C113,C118-C119,C129,
 ;  C130-C132,C138-C139,C140,C142,C148,C300-C313,C318-C319,C320-C323,
 ;  C328-C329 H8720-8790
 I ((ONCT3>2)&(ONCT3<6))!((ONCT3>7)&(ONCT3<10))!(ONCT3="019")!((ONCT3>19)&(ONCT3<25))!((ONCT3>27)&(ONCT3<32))!((ONCT3>38)&(ONCT3<42))!((ONCT3>47)&(ONCT3<53)) D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00140"
 I ((ONCT3>57)&(ONCT3<63))!(ONCT3="068")!(ONCT3="069")!(ONCT3="090")!(ONCT3="091")!((ONCT3>97)&(ONCT3<105))!((ONCT3>107)&(ONCT3<114))!(ONCT3=118)!(ONCT3=119)!((ONCT3>128)&(ONCT3<133)) D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00140"
 I ((ONCT3>137)&(ONCT3<141))!(ONCT3=142)!(ONCT3=148)!((ONCT3>299)&(ONCT3<314))!(ONCT3=318)!(ONCT3=319)!((ONCT3>319)&(ONCT3<324))!(ONCT3=328)!(ONCT3=329) D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00140"
 ;
 ;MELANOMA IRIS: C694 H8720-8790
 I ONCTPCD="C694" D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00671"
 ;
 ;MELANOMA SKIN: C000-C002,C006,C440-C449,C500,C510-C512,C518-C519
 ;    C600-C602,C608-C609,C632 H8720-8790
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<3))!(ONCT3="006")!((ONCT3>439)&(ONCT3<450))!(ONCT3=500)!((ONCT3>509)&(ONCT3<513))!(ONCT3=518)!(ONCT3=519)!((ONCT3>599)&(ONCT3<603))!(ONCT3=608)!(ONCT3=609)!(ONCT3=632) D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00470"
 ;
 ;MERKEL CELL SKIN: C000-C006,C008,C009,C440-C449,C510-C512,C518-C519
 ;    C600-C602,C608-C609,C632,C809 H8041,8190,8247
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<7))!(ONCT3="008")!((ONCT3>439)&(ONCT3<450))!((ONCT3>509)&(ONCT3<513))!(ONCT3=518)!(ONCT3=519)!((ONCT3>599)&(ONCT3<603))!(ONCT3=608)!(ONCT3=609)!(ONCT3=632)!(ONCT3=809) D  I ONCSCMA'=0 Q
 .I (HST14=8041)!(HST14=8190)!(HST14=8247) S ONCSCMA="00460"
 ;
 ;MIDDLE EAR: C301 H8000-8700,9700,9701
 I ONCTPCD="C301" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00119"
 ;
 ;MOUTH OTHER: C058-C059,C068-C069 H8000-8700,8982,9700,9701
 I "C058^C059^C068^C069^"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00077"
 ;
 ;MYCOSIS FUNGOIDES: C000-C002,C006,C440-C449,C510-C512,C518-C519,C600-C602,C608-C609,C632 H9700,9701
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<3))!(ONCT3="006")!((ONCT3>439)&(ONCT3<450))!((ONCT3>509)&(ONCT3<513))!(ONCT3=518)!(ONCT3=519)!((ONCT3>599)&(ONCT3<603))!(ONCT3=608)!(ONCT3=609)!(ONCT3=632) D  I ONCSCMA'=0 Q
 .I (HST14=9700)!(HST14=9701) S ONCSCMA="00811"
 ;
 ;NASAL CAVITY AND ETHMOID SINUS: C300,C311 H8000-8700,8982,9700,9701
 I "C300^C311"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00122"
 ;
 ;NASOPHARYNX: C110,C112-C113,C118-C119 H8000-8700,9700,9701
 ; or   C111 H8000-8700,9700,9701 DISCR1=1
 I "C110^C112^C113^C118^C119"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00090"
 I ONCTPCD="C111" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) D
 ..I ONCSDIS1=1 S ONCSCMA="00090"
 ;
 ;NET ADRENAL GLAND: C740,C741,C749,C755 H8680,8690,8692,8693,8700
 I "C740^C741^C749^C755"[ONCTPCD D  I ONCSCMA'=0 Q
 .I (HST14=8680)!(HST14=8690)!(HST14=8692)!(HST14=8693)!(HST14=8700) S ONCSCMA="00770"
 ;
 ;NET AMPULLA OF VATER: C241 H8150-8153,8155-56,8158,8240-8242,8249,8683
 I ONCTPCD="C241" D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00302"
 ;
 ;NET APPENDIX: C181 H8150-8153,8155-56,8158,8240-8242,8249,8683
 I ONCTPCD="C181" D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00320"
 ;
 ;NET COLON AND RECTUM: C180,C182-C189,C199,C209 H8150-8153,8155-56,8158
 ;  8240-8242,8249,8683
 I "C180^C182^C183^C184^C185^C186^C187^C188^C189^C199^C209"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00330"
 ;
 ;NET DUODENUM: C170 H8150-8153,8155-56,8158,8240-8242,8249,8683
 I ONCTPCD="C170" D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00301"
 ;
 ;NET JEJUNUM AND ILEUM: C171-C173,C178-C179 H8150-8153,8155-56,8158
 ;  8240-8242,8249,8683
 I "C171^C172^C173^C178^C179"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00310"
 ;
 ;NET PANCREAS: C250-C254,C257-C259 H8150-8153,8155-56,8158,8240-8242
 ;  8249,8683
 I "C250^C251^C252^C253^C254^C257^C258^C259"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00340"
 ;
 ;NET STOMACH: C160-C166,C168-C169 H8150-8153,8155-56,8158,8240-8242
 ;  8249,8683
 I "C160^C161^C162^C163^C164^C165^C166^C168^C169"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>8149)&(HST14<8154))!(HST14=8155)!(HST14=8156)!(HST14=8158)!(HST14=8240)!(HST14=8241)!(HST14=8242)!(HST14=8249)!(HST14=8683) S ONCSCMA="00290"
 ;
 ;ORBITAL SARCOMA: C690-C694,C696,C698-C699 H8710-8714,8800-8921,8932-34
 ;  8940-8990,9000-9016,9030-9137,9141-9175,9181-9230,9240-9509,9520-9582
 ;  or C695 H8710-8714,8800-8921,8932-8934,8940,8950-8975,8981,8983-8990
 ;      9000-9016,9030-9137,9141-9175,9181-9230,9240-9509,9520-9582
 ;  or C723 H8710-8714,8800-8921,8932-8934,8940-8990,9000-9016,9030-9063
 ;      9065,9071-9073,9081-9083,9086-9091,9101-9137,9141-9175,9181-9230
 ;      9240-9361,9363-9381,9383-9384,9394,9410,9412-9423,9431-9432,9444
 ;      9460,9472-9473,9480,9491-9500,9502-9504,9506-9507,9509,9520-9537
 ;      9539-9582
 ; (remove 9222 from 00700 schema for NAACCR 2022 p17)
 I "C690^C691^C692^C693^C694^C696^C698^C699"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>8709)&(HST14<8715))!((HST14>8799)&(HST14<8922))!((HST14>8931)&(HST14<8935))!((HST14>8939)&(HST14<8991))!((HST14>8999)&(HST14<9017))!((HST14>9029)&(HST14<9138)) S ONCSCMA="00700" Q
 .I ((HST14>9140)&(HST14<9176))!((HST14>9180)&(HST14<9222))!((HST14>9222)&(HST14<9231))!((HST14>9239)&(HST14<9510))!((HST14>9519)&(HST14<9583)) S ONCSCMA="00700" Q
 I ONCTPCD="C695" D  I ONCSCMA'=0 Q
 .I ((HST14>8709)&(HST14<8715))!((HST14>8799)&(HST14<8922))!((HST14>8931)&(HST14<8935))!(HST14=8940)!((HST14>8949)&(HST14<8976))!(HST14=8981)!((HST14>8982)&(HST14<8991))!((HST14>8999)&(HST14<9017)) S ONCSCMA="00700" Q
 .I ((HST14>9029)&(HST14<9138))!((HST14>9140)&(HST14<9176))!((HST14>9180)&(HST14<9222))!((HST14>9222)&(HST14<9231))!((HST14>9239)&(HST14<9510))!((HST14>9519)&(HST14<9583)) S ONCSCMA="00700" Q
 I ONCTPCD="C723" D  I ONCSCMA'=0 Q
 .I ((HST14>8709)&(HST14<8715))!((HST14>8799)&(HST14<8922))!((HST14>8931)&(HST14<8935))!((HST14>8939)&(HST14<8991))!((HST14>8999)&(HST14<9017)) S ONCSCMA="00700" Q
 .I ((HST14>9029)&(HST14<9064))!(HST14=9065)!((HST14>9070)&(HST14<9074))!((HST14>9080)&(HST14<9084))!((HST14>9085)&(HST14<9092))!((HST14>9100)&(HST14<9138))!((HST14>9140)&(HST14<9176)) S ONCSCMA="00700" Q
 .I ((HST14>9180)&(HST14<9222))!((HST14>9222)&(HST14<9231))!((HST14>9239)&(HST14<9362))!((HST14>9362)&(HST14<9382))!(HST14=9383)!(HST14=9384)!(HST14=9394)!(HST14=9410)!((HST14>9411)&(HST14<9424))!(HST14=9431)!(HST14=9432) S ONCSCMA="00700" Q
 .I (HST14=9444)!(HST14=9460)!(HST14=9472)!(HST14=9473)!(HST14=9480)!((HST14>9490)&(HST14<9501))!((HST14>9501)&(HST14<9505))!(HST14=9506)!(HST14=9507)!(HST14=9509)!((HST14>9519)&(HST14<9538))!((HST14>9538)&(HST14<9583)) S ONCSCMA="00700" Q
 ;
 ;OROPHARYNX (P16-): C019,C024,C051,C052,C090,C091,C098,C099,C100,C102-C104
 ;    C108,C109 H8000-8700,9700,9701 DISCR2=1,9
 ;  or  C111 H8000-8700,9700,9701 DISCR1=2 AND DISCR2=1,9
 I "C019^C024^C051^C052^C090^C091^C098^C099^C100^C102^C103^C104^C108^C109"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) D
 ..I ((ONCSDIS2=1)!(ONCSDIS2=9)) S ONCSCMA="00111"
 I ONCTPCD="C111" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) D
 ..I (ONCSDIS1=2)&((ONCSDIS2=1)!(ONCSDIS2=9)) S ONCSCMA="00111"
 ;
 ;OROPHARYNX HPV-MEDIATED (P16+): C019,C024,C051,C052,C090,C091,C098,C099
 ;    C100,C102-C104,C108,C109 H8000-8700,9700,9701 DISCR2=2
 ;  or  C111 H8000-8700,9700,9701 DISCR1=2 AND DISCR2=2
 I "C019^C024^C051^C052^C090^C091^C098^C099^C100^C102^C103^C104^C108^C109"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) D
 ..I ONCSDIS2=2 S ONCSCMA="00100"
 I ONCTPCD="C111" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) D
 ..I (ONCSDIS1=2)&(ONCSDIS2=2) S ONCSCMA="00100"
 ;
 ;OVARY: C569 H8000-8700,8720-8790,8806,8810,8815,8822,8825,8890,8930-
 ;  8931,8933,8935-8936,8950,8960,8980,9000,9050,9052,9060,9070-9071,
 ;  9073,9080,9085,9090-9091,9100,9110,9700-9701
 I ONCTPCD="C569" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=8806)!(HST14=8810)!(HST14=8815)!(HST14=8822)!(HST14=8825)!(HST14=8890)!(HST14=8930)!(HST14=8931)!(HST14=8933)!(HST14=8935)!(HST14=8936) S ONCSCMA="00551"
 .I (HST14=8950)!(HST14=8960)!(HST14=8980)!(HST14=9000)!(HST14=9050)!(HST14=9052)!(HST14=9060)!(HST14=9070)!(HST14=9071)!(HST14=9073)!(HST14=9080)!(HST14=9085)!(HST14=9090)!(HST14=9091)!(HST14=9100)!(HST14=9110) S ONCSCMA="00551"
 .I (HST14=9700)!(HST14=9701) S ONCSCMA="00551"
 ;
 ;PALATE HARD: C050 H8000-8700,8982,9700,9701
 I ONCTPCD="C050" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00075"
 ;
 ;PANCREAS: C250-C254,C257-C259 H8000-8149,8154,8157,8160-8231,8243-8248,
 ;    8250-8682,8690-8700,8720-8790,8971,9700,9701
 I "C250^C251^C252^C253^C254^C257^C258^C259^"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8150))!(HST14=8154)!(HST14=8157)!((HST14>8159)&(HST14<8232))!((HST14>8242)&(HST14<8249)) S ONCSCMA="00280"
 .I ((HST14>8249)&(HST14<8683))!((HST14>8689)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00280"
 ;
 ;PARATHYROID: C750 H8000-8700,8720-8790,9700,9701
 I ONCTPCD="C750" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00750"
 ;
 ;PENIS: C600-C602,C608-C609 H8000-8040,8042-8180,8191-8246,8248-8700
 I "C600^C601^C602^C608^C609^"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8041))!((HST14>8041)&(HST14<8181))!((HST14>8190)&(HST14<8247))!((HST14>8247)&(HST14<8701)) S ONCSCMA="00570"
 ;
 ;PHARYNX OTHER: C140,C142,C148 H8000-8700,9700,9701
 I "C140^C141^C148^"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00118"
 ;
 ;PLACENTA: C589 H8000-8700,8720-8790,9100-9105,9700,9701
 I ONCTPCD="C589" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!((HST14>9099)&(HST14<9106))!(HST14=9700)!(HST14=9701) S ONCSCMA="00560"
 ;
 Q