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

ONCSCHMB.m

Go to the documentation of this file.
ONCSCHMB ;HINES OIFO/RTK - Schema derivation, related code continued ;05/09/18
 ;;2.2;ONCOLOGY;**10,12,18**;Jul 31, 2013;Build 5
 ;
 ; go through until hit is found, else return ONCSCMA=0
 ;
 ;EYE OTHER: C691-C694,C696,C698-C699 H8000-8700,9700,9701
 ;  or  C691-C692,C695-C696,C698-C699 H8720-8790
 I "C691^C692^C693^C694^C696^C698^C699"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00718"
 I "C691^C692^C695^C696^C698^C699"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>8719)&(HST14<8791)) S ONCSCMA="00718"
 ;
 ;FALLOPIAN TUBE: C570 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="C570" 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>8929)&(HST14<8932))!(HST14=8933)!(HST14=8935)!(HST14=8936) S ONCSCMA="00553"
 .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) S ONCSCMA="00553"
 .I (HST14=9100)!(HST14=9110)!(HST14=9700)!(HST14=9701) S ONCSCMA="00553"
 ;
 ;FLOOR OF MOUTH: C040-C041,C048-C049 H8000-8700,8982,9700,9701
 I "C040^C041^C048^C049"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00074"
 ;
 ;GALLBLADDER: C239 H8000-8700,8720-8790,9700-9701
 I ONCTPCD="C239" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00241"
 ;
 ;GENITAL FEMALE OTHER: C577-C579 H8000-8700,8720-8790,9700-9701
 I "C577^C578^C579"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00559"
 ;
 ;GENITAL MALE OTHER: C630-C631,C637-C639 H8000-8700,8720-8790,9700-9701
 ;  or C632 H8000-8040,8042-8180,8191-8246,8248-8700
 I "C630^C631^C637^C638^C639"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00598"
 I ONCTPCD="C632" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8041))!((HST14>8041)&(HST14<8181))!((HST14>8190)&(HST14<8247))!((HST14>8247)&(HST14<8701)) S ONCSCMA="00598"
 ;
 ;GIST: C000-C539,C571-C809 H8935,8936  ;ONCT3 USED FOR WIDE RANGES
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<540))!((ONCT3>570)&(ONCT3<810)) D  I ONCSCMA'=0 Q
 .I (HST14=8935)!(HST14=8936) S ONCSCMA="00430"
 ;
 ;GUM: C030,C031,C039,C062 H8000-8700,8982,9700-9701
 I "C030^C031^C039^C062"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00073"
 ;
 ;HEART,MEDIASTINUM AND PLEURA: C380-C383,C388 H8000-8803,8810-8921,8932-
 ;      8934,8940-8990,9000-9016,9030,9040-9043,9045-9137,9141-9230,9240-
 ;      9580,9582,9700-9701
 ;  or C384 H8000-8803,8810-8921,8932-8934,8940-8990,9000-9016,9030,9040-
 ;      9043,9045,9054-9137,9141-9230,9240-9580,9582,9700-9701
 I "C380^C381^C382^C383^C388"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8804))!((HST14>8809)&(HST14<8922))!((HST14>8931)&(HST14<8935))!((HST14>8939)&(HST14<8991))!((HST14>8999)&(HST14<9017))!(HST14=9030)!((HST14>9039)&(HST14<9044)) S ONCSCMA="00422"
 .I ((HST14>9044)&(HST14<9138))!((HST14>9140)&(HST14<9231))!((HST14>9239)&(HST14<9581))!(HST14=9582)!(HST14=9700)!(HST14=9701) S ONCSCMA="00422"
 I ONCTPCD="C384" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8804))!((HST14>8809)&(HST14<8922))!((HST14>8931)&(HST14<8935))!((HST14>8939)&(HST14<8991))!((HST14>8999)&(HST14<9017))!(HST14=9030)!((HST14>9039)&(HST14<9044)) S ONCSCMA="00422"
 .I (HST14=9045)!((HST14>9053)&(HST14<9138))!((HST14>9140)&(HST14<9231))!((HST14>9239)&(HST14<9581))!(HST14=9582)!(HST14=9700)!(HST14=9701) S ONCSCMA="00422"
 ;
 ;HEMERETIC: C000-C440,C442-C689,C691-C694,C698-C699,C739-C749
 ;     C750,C754-C759,C760-C809 H9591 DISCR1=1,2
 ;  or C700-C729, C751-C753 H95913 DISCR1=1,2
 ;  or C000-C809 H9724,9727,9740-9742,9762-9809,9811-9820
 ;      9831-9920,9931-9993
 ;  or C000-C699,C739-C750,C754-C809 H9751,9755-9759
 ;  or C000-C440,C442-C689,C691-C694,C698-C809 H9930
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<441))!((ONCT3>441)&(ONCT3<690))!((ONCT3>690)&(ONCT3<695))!((ONCT3>697)&(ONCT3<700))!((ONCT3>738)&(ONCT3<751))!((ONCT3>753)&(ONCT3<810)) D  I ONCSCMA'=0 Q
 .I (HST14=9591) D
 ..I ((ONCSDIS1=1)!(ONCSDIS1=2)) S ONCSCMA="00830"
 .I (HST14=9930) S ONCSCMA="00830"
 I ((ONCT3>699)&(ONCT3<730))!((ONCT3>750)&(ONCT3<754)) D  I ONCSCMA'=0
 .I (ONCHIST=95913) D
 ..I ((ONCSDIS1=1)!(ONCSDIS1=2)) S ONCSCMA="00830"
 .I (HST14=9724)!(HST14=9727)!((HST14>9739)&(HST14<9743))!((HST14>9761)&(HST14<9810))!((HST14>9810)&(HST14<9821))!((HST14>9830)&(HST14<9921))!((HST14>9930)&(HST14<9994)) D
 ..I $E(ONCHIST,5)=3 S ONCSCMA="00830"
 .I (ONCHIST=99303) S ONCSCMA="00830"
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<700))!((ONCT3>738)&(ONCT3<751))!((ONCT3>753)&(ONCT3<810)) D  I ONCSCMA'=0 Q
 .I (HST14=9724)!(HST14=9727)!((HST14>9739)&(HST14<9743))!((HST14>9761)&(HST14<9810))!((HST14>9810)&(HST14<9821))!((HST14>9830)&(HST14<9921))!((HST14>9930)&(HST14<9994)) S ONCSCMA="00830"
 .I (HST14=9751)!((HST14>9754)&(HST14<9760)) S ONCSCMA="00830"
 ;
 ;HYPOPHARYNX: C129,C130-C132,C138-C139 H8000-8700,9700,9701
 I "C129^C130^C131^C132^C138^C139"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00112"
 ;
 ;ILL-DEFINED OTHER: C420-C424,C761-C765,C767-C768,C770-C775,C778-C779
 ;        H8000-8700,9700,9701
 ;  or   C760 H8000-8700,9700,9701 DISCR1=0,1
 ;  or   C809 8000-8180,8191-8246,8248-8700,8720-8790,9700,9701
 I "C420^C421^C422^C423^C424^C761^C762^C763^C764^C765^C767^C768^C770^C771^C772^C773^C774^C775^C778^C779"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="99999"
 I ONCTPCD="C760" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) D
 ..I ((ONCSDIS1=0)!(ONCSDIS1=1)) S ONCSCMA="99999"
 I ONCTPCD="C809" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8181))!((HST14>8190)&(HST14<8247))!((HST14>8247)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="99999"
 ;
 ;INTRACRANIAL GLAND: https://staging.seer.cancer.gov/eod_public/schema/3.0/intracranial_gland_v9_2023/?breadcrumbs=(~schema_list~)
 D ITC723^ONCSCHMW I ONCSCMA'=0 Q
 ;
 ;KAPOSI SARCOMA: C000-C699,C739-C750,C754-C809 H9140
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<700))!((ONCT3>738)&(ONCT3<751))!((ONCT3>753)&(ONCT3<810)) D  I ONCSCMA'=0 Q
 .I (HST14=9140) S ONCSCMA="00458"
 ;
 ;KIDNEY PARENCHYMA: C649 H8000-8700,8720-8790,9700,9701
 I ONCTPCD="C649" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00600"
 ;
 ;KIDNEY RENAL PELVIS: C659,C669 H8000-8700,8720-8790,9700,9701
 I ONCTPCD="C659"!(ONCTPCD="C669") D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00610"
 ;
 ;LACRIMAL GLAND: C695 H8000-8700,8941,8980,8982,9700,9701
 I ONCTPCD="C695" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8941)!(HST14=8980)!(HST14=8982)!(HST14=9700)!(HST14=9701) D
 ..I ONCSDIS1=1 S ONCSCMA="00690"
 ;
 ;LACRIMAL SAC: C695 H8000-8700,8941,8980,8982,9700,9701
 I ONCTPCD="C695" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8941)!(HST14=8980)!(HST14=8982)!(HST14=9700)!(HST14=9701) D
 ..I ((ONCSDIS1=2)!(ONCSDIS1=9)) S ONCSCMA="00698"
 ;
 ;LARYNX GLOTTIC: C320 H8000-8700,9700,9701
 I ONCTPCD="C320" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00132"
 ;
 ;LARYNX OTHER: C323,C328,C329 H8000-8700,9700,9701
 I (ONCTPCD="C323")!(ONCTPCD="C328")!(ONCTPCD="C329") D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00130"
 ;
 ;LARYNX SUBGLOTTIC: C322 H8000-8700,9700,9701
 I ONCTPCD="C322" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00133"
 ;
 ;LARYNX SUPRAGLOTTIC: C101,C321 H8000-8700,9700,9701
 I (ONCTPCD="C101")!(ONCTPCD="C321") D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=9700)!(HST14=9701) S ONCSCMA="00131"
 ;
 ;LIP: C003,C004,C005,C008,C009 H8000-8040,8042-8180,8191-8246,8248-8700,
 ;      8982,9700,9701
 I (ONCTPCD="C003")!(ONCTPCD="C004")!(ONCTPCD="C005")!(ONCTPCD="C008")!(ONCTPCD="C009") D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8041))!((HST14>8041)&(HST14<8181))!((HST14>8190)&(HST14<8247))!((HST14>8247)&(HST14<8701))!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00071"
 ;
 ;LIVER: C220 H8000-8700,8720-8790,9700,9701
 I ONCTPCD="C220" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=9700)!(HST14=9701) S ONCSCMA="00220"
 ;
 ;LUNG: C340,C341,C342,C343,C348,C349 H8000-8700,8720-8790,8972,8980
 ;       9700,9701
 I (ONCTPCD="C340")!(ONCTPCD="C341")!(ONCTPCD="C342")!(ONCTPCD="C343")!(ONCTPCD="C348")!(ONCTPCD="C349") D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=8972)!(HST14=8980)!(HST14=9700)!(HST14=9701) S ONCSCMA="00360"
 ;
 ;LYMPHOMA: C000-C424,C470-C509,C511-C608,C619-C631,C637-C689,C691-C694,
 ;     C698-C699,C739-C749,C760-C809 H9590,9596-9663,9673-9699,9702-9719,
 ;     9725-9726,9735,9737-9738
 ; or  C440,C442-C449,C510,C609,C632 H9590,9596,9650-9663,9673-9679,9687-
 ;     9699,9702-9705,9714-9717,9725,9735,9737-9738
 ; or  C700-C729,C750-C759 H9590,9596-9663,9673-9679,9687-9698,9716-9719
 ;     9725-9726,9735,9737-9738 HST5 MUST = 3
 ; or  C000-C440,C442-C689,C691-C694,C698-C699,C700-C729,C739-C749,C750-
 ;     C759,C760-C809 H9591 DISCR1=3,9
 ; or  C700-C729, C751-C753 H95913 DISCR1=3,9
 ; or  C750,C754-C759 H9680,9699,9702-9714
 ; or  C000-C440,C442-C689,C691-C694,C698-C699,C700-C729,C739-C749,C750-
 ;     C759,C760-C809 H9826-9827 HST5 MUST = 3
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<425))!((ONCT3>469)&(ONCT3<510))!((ONCT3>510)&(ONCT3<609))!((ONCT3>618)&(ONCT3<632))!((ONCT3>636)&(ONCT3<690))!((ONCT3>690)&(ONCT3<695))!((ONCT3>697)&(ONCT3<700)) D  I ONCSCMA'=0 Q
 .I (HST14=9590)!((HST14>9595)&(HST14<9664))!((HST14>9672)&(HST14<9700))!((HST14>9701)&(HST14<9720))!((HST14>9724)&(HST14<9727))!(HST14=9735)!((HST14>9736)&(HST14<9739)) S ONCSCMA="00790"
 .I (HST14=9591) D
 ..I ((ONCSDIS1=3)!(ONCSDIS1=9)) S ONCSCMA="00790"
 .I (HST14=9826)!(HST14=9827) S ONCSCMA="00790"
 I ((ONCT3>738)&(ONCT3<750))!((ONCT3>759)&(ONCT3<810)) D  I ONCSCMA'=0 Q
 .I (HST14=9590)!((HST14>9595)&(HST14<9664))!((HST14>9672)&(HST14<9700))!((HST14>9701)&(HST14<9720))!((HST14>9724)&(HST14<9727))!(HST14=9735)!((HST14>9736)&(HST14<9739)) S ONCSCMA="00790"
 .I (HST14=9591) D
 ..I ((ONCSDIS1=3)!(ONCSDIS1=9)) S ONCSCMA="00790"
 .I (HST14=9826)!(HST14=9827) S ONCSCMA="00790"
 I "C440^C442^C443^C444^C445^C446^C447^C448^C449^C510^C609^C632"[ONCTPCD D  I ONCSCMA'=0 Q
 .I (HST14=9590)!(HST14=9596)!((HST14>9649)&(HST14<9664))!((HST14>9672)&(HST14<9680))!((HST14>9686)&(HST14<9700))!((HST14>9701)&(HST14<9706))!((HST14>9713)&(HST14<9718))!(HST14=9725)!(HST14=9735)!(HST14=9737)!(HST14=9738) S ONCSCMA="00790"
 I ((ONCT3>699)&(ONCT3<730))!((ONCT3>750)&(ONCT3<754)) D  I ONCSCMA'=0
 .I (HST14=9590)!((HST14>9595)&(HST14<9664))!((HST14>9672)&(HST14<9680))!((HST14>9686)&(HST14<9699))!((HST14>9715)&(HST14<9720))!(HST14=9725)!(HST14=9726)!(HST14=9735)!((HST14>9736)&(HST14<9739)) D
 ..I $E(ONCHIST,5)=3 S ONCSCMA="00790"
 .I (ONCHIST=95913) D
 ..I ((ONCSDIS1=3)!(ONCSDIS1=9)) S ONCSCMA="00790"
 .I (ONCHIST=98263)!(ONCHIST=98273) S ONCSCMA="00790"
 I "C750^C754^C755^C756^C757^C758^C759"[ONCTPCD D  I ONCSCMA'=0 Q
 .I (HST14=9590)!((HST14>9595)&(HST14<9664))!((HST14>9672)&(HST14<9680))!((HST14>9686)&(HST14<9699))!((HST14>9715)&(HST14<9720))!(HST14=9725)!(HST14=9726)!(HST14=9735)!((HST14>9736)&(HST14<9739)) S ONCSCMA="00790"
 .I (HST14=9680)!(HST14=9699)!((HST14>9701)&(HST14<9715)) S ONCSCMA="00790"
 ;
 ;LYMPHOMA OCULAR ADNEXA: C441,C690,C695-C696 H9590-9699,9702-9719,9725-
 ;  9726,9734-9738,9823,9826-9827,9930
 I "C441^C690^C695^C696"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>9589)&(HST14<9700))!((HST14>9701)&(HST14<9720))!(HST14=9725)!(HST14=9726)!((HST14>9733)&(HST14<9739))!(HST14=9823)!(HST14=9826)!(HST14=9827)!(HST14=9930) S ONCSCMA="00710"
 ;
 ;LYMPHOMA-CLL/SLL: C000-C440,C442-C689,C691-C694,C698-C809 H9823
 I (ONCT3="000")!((ONCT3>0)&(ONCT3<441))!((ONCT3>441)&(ONCT3<690))!((ONCT3>690)&(ONCT3<695))!((ONCT3>697)&(ONCT3<810)) D  I ONCSCMA'=0 Q
 .I (HST14=9823) S ONCSCMA="00795"
 ;
 ;MAJOR SALIVARY GLANDS: C079,C080,C081,C088,C089 H8000-8700,8720-8790,
 ;    8941,8974,8980,8982,9700,9701
 I "C079^C080^C081^C088^C089"[ONCTPCD D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!((HST14>8719)&(HST14<8791))!(HST14=8941)!(HST14=8974)!(HST14=8980)!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00080"
 ;
 ;MAXILLARY SINUS: C310 H8000-8700,8941,8982,9700,9701
 I ONCTPCD="C310" D  I ONCSCMA'=0 Q
 .I ((HST14>7999)&(HST14<8701))!(HST14=8941)!(HST14=8982)!(HST14=9700)!(HST14=9701) S ONCSCMA="00121"
 ;
 Q