All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edits.seer.internal.rules.IFN6141.xml Maven / Gradle / Ivy

There is a newer version: 024-13
Show newest version
        <rule id="IFN6141" name="Summary Stage 2018, EOD Tumor/Nodes/Mets, Schema ID (SEER)" tag="N6141" java-path="lines.line" category="inter-field" depends="Year_of_Diagnosis">
            <expression><![CDATA[if (line.dateOfDiagnosisYear == null || line.dateOfDiagnosisYear < '2019' || line.summaryStage2018 == null)
    return true
if (line.schemaId == null || line.typeOfReportingSource == '7' || ['0', '1'].contains(line.behaviorCodeIcdO3) || line.behaviorCodeIcdO3 == null)
    return true
if (line.eodPrimaryTumor == null && line.eodRegionalNodes == null && line.eodMets == null)
    return true

boolean passing = true

Map eodValuesMap = (Map)((Map)((Map)Context.Summary_Stage_EOD_Table).get(line.summaryStage2018))?.get(line.schemaId)
Map eodPrimaryTumorValues = (Map)eodValuesMap?.get('eodPrimaryTumor')
Map eodRegionalNodesValues = (Map)eodValuesMap?.get('eodRegionalNodes')
Map eodMetsValues = (Map)eodValuesMap?.get('eodMets')

if (eodPrimaryTumorValues != null) {
    List eqValues = (List)eodPrimaryTumorValues.get('eq')
    passing &= (eqValues == null || (line.eodPrimaryTumor != null && eqValues.contains(line.eodPrimaryTumor)))
    List neValues = (List)eodPrimaryTumorValues.get('ne')
    passing &= (neValues == null || (line.eodPrimaryTumor == null || !neValues.contains(line.eodPrimaryTumor)))
}
if (eodRegionalNodesValues != null) {
    List eqValues = (List)eodRegionalNodesValues.get('eq')
    passing &= (eqValues == null || (line.eodRegionalNodes != null && eqValues.contains(line.eodRegionalNodes)))
    List neValues = (List)eodRegionalNodesValues.get('ne')
    passing &= (neValues == null || (line.eodRegionalNodes == null || !neValues.contains(line.eodRegionalNodes)))
}
if (eodMetsValues != null) {
    List eqValues = (List)eodMetsValues.get('eq')
    passing &= (eqValues == null || (line.eodMets != null && eqValues.contains(line.eodMets)))
    List neValues = (List)eodMetsValues.get('ne')
    passing &= (neValues == null || (line.eodMets == null || !neValues.contains(line.eodMets)))
}

boolean schemaIdInList5To10 =
((List)Context.EOD_SchemaId_List_5).contains(line.schemaId) ||
((List)Context.EOD_SchemaId_List_6).contains(line.schemaId) ||
((List)Context.EOD_SchemaId_List_7).contains(line.schemaId) ||
((List)Context.EOD_SchemaId_List_8).contains(line.schemaId) ||
((List)Context.EOD_SchemaId_List_9).contains(line.schemaId) ||
((List)Context.EOD_SchemaId_List_10).contains(line.schemaId)

passing &= (!schemaIdInList5To10 || line.summaryStage2018 != '0')

passing &= (line.schemaId != '00060' || !['1', '2', '4'].contains(line.summaryStage2018))

passing &= (!['00721','00722','00723','09721','09722','09723','09724','00790','00795'].contains(line.schemaId) || !['3', '4'].contains(line.summaryStage2018))

boolean eodMetsCondition = (line.eodMets >= '10' && line.eodMets <= '70') || (line.schemaId == '00370' && line.eodMets == '05') || (line.schemaId == '00458' && line.eodRegionalNodes == '700')
passing &= (!eodMetsCondition || line.summaryStage2018 == '7')

if (line.schemaId == '00790' || line.schemaId == '00795') {
    if (line.summaryStage2018 == '1')
        passing &= ['100', '200'].contains(line.eodPrimaryTumor)
    else if (line.summaryStage2018 == '2')
        passing &= ['300', '400', '500'].contains(line.eodPrimaryTumor)
    else if (line.summaryStage2018 == '7')
        passing &= ['575', '600', '700', '750', '800'].contains(line.eodPrimaryTumor)
}

return passing]]></expression>
            <message>Summary Stage 2018 conflicts with EOD Primary Tumor, EOD Regional Nodes, and EOD Mets</message>
            <description><![CDATA[This edit checks consistency of coding between Summary Stage 2018 for
in situ and invasive cases and EOD Primary Tumor, EOD Regional Nodes, and EOD
Mets by Schema ID for all Schema IDs excluding 00580, Prostate.

1. This edit is skipped if any of the following conditions is true:
    a. Diagnosis date is invalid, blank (unknown), or before 2019.
    b. Schema ID is blank
    c. Summary Stage 2018 is blank
    d. Behavior Code ICD-O-3 is blank or = 0 or 1
    e. EOD Primary Tumor, EOD Regional Nodes, and EOD Mets are all blank
    f. Type of Reporting Source = 7 (Death Certificate Only)

2. If Summary Stage 2018 = 0 (in situ)
    a. If Schema ID = 00480, EOD Primary Tumor must = 000, 050, or 070 and
        EOD Regional Nodes must = 000, 030, 050, or 070 and EOD Mets must =
        00 or 05
    b. If Schema ID = 00553 (Fallopian Tube), EOD
        Primary Tumor must = 000, 050, 070, or 080 and EOD Regional Nodes must = 000 or 050
        and EOD Mets must = 00
    c. If Schema ID = 00530 (Corpus Carcinoma) or 00551 (Ovary), EOD Primary
        Tumor must = 000 or 050 and EOD Regional Nodes must = 000 or 050 and EOD Mets must = 00
    d. If Schema ID = 00723 (Intracranial Gland 8th: 2018-2022), or 09723 (Intracranial
        Gland V9: 2023+) EOD Primary Tumor must = 000 and EOD Mets must = 00
    e. If Schema ID is in list 1, EOD Primary Tumor must = 000 or 050,
        EOD Regional Nodes must = 000, and EOD Mets must = 00
    f. If Schema ID is in list 2, EOD Primary Tumor must = 000,
        EOD Regional Nodes must = 000, and EOD Mets must = 00
    g. If Schema ID is in list 3, EOD Primary Tumor must = 000 and
        EOD Regional Nodes must = 000, 040, or 050 and EOD Mets must = 00
    h. If Schema ID is in list 4, EOD Primary Tumor must = 000 and
        EOD Regional Nodes must = 000 or 050 or 070 and EOD Mets must = 00

3. If Schema ID is in list 5, 6, 7, 8, 9, or 10, Summary Stage 2018 must
    not = 0

4. If Summary Stage = 1 (localized) or 2 (regional by direct extension)
    a. If Schema ID = 00480, EOD Primary Tumor must not = 000, 800, or 999 and
        EOD Regional Nodes must = 000, 030, 050, 070, or 999 and EOD Mets must =
        00 or 05
    b. If Schema ID = 00553 (Fallopian Tube), EOD
        Primary Tumor must not = 000, 050, 070, 080, 800, or 999 and EOD Regional
        Nodes must = 000, 050, or 999 and EOD Mets must = 00
    c. If Schema ID = 00530 (Corpus Carcinoma) or 00551, (Ovary), EOD Primary
        Tumor must not = 000, 050, 800, or 999 and EOD Regional Nodes must = 000, 050,
        or 999 and EOD Mets must = 00
    d. If Schema ID = 00723 (Intracranial Gland ), 8th: 2018-2022) or 09723 (Intracranial
        Gland V9: 2023+), EOD Primary Tumor must not = 000, 050, 800, or 999 and EOD Mets must = 00
    e. If Schema ID is in list 1, EOD Primary Tumor must not = 000, 050, 800, or
        999 and EOD Regional Nodes must = 000 or 999, and EOD Mets must = 00
    f. If Schema ID is in list 2, EOD Primary Tumor must not = 000, 800, or 999
        and EOD Regional Nodes must = 000 or 999, and EOD Mets must = 00
    g. If Schema ID is in list 3, EOD Primary Tumor must not = 000, 800, or 999
        and EOD Regional Nodes must = 000, 040, 050, or 999 and EOD Mets must = 00
    h. If Schema ID is in list 4, EOD Primary Tumor must not = 000, 800, or 999
        and EOD Regional Nodes must = 000 or 050, 070, or 999  and EOD Mets must
        = 00
    i. If Schema ID is in list 5, EOD Primary Tumor must not = 800 or 999 and
        EOD Regional Nodes must = 000 or 999 and EOD Mets must = 00
    j. If Schema ID is in list 6, EOD Primary Tumor must not = 800 or 999 and
        EOD Regional Nodes must = 000, 050, or 999 and EOD Mets must = 00
    k. If Schema ID is in list 7, EOD Primary Tumor must not = 800 or 999 and
        EOD Regional Nodes must = 000, 987, or 999
    l. If Schema ID is in list 8, EOD Primary Tumor must not = 050, 800, or 999
        and EOD Mets must = 00

5. If Summary Stage = 3 (regional to lymph nodes)
    a. If Schema ID = 00480, EOD Regional Nodes must not = 000, 030, 050, 070, or
        999 and EOD Mets must = 00 or 05
    b. If Schema ID is in list 1, 2, 5, or 9, EOD Regional Nodes must not = 000 or
        999, and EOD Mets must = 00
    c. If Schema ID is in list 3 or 6 or Schema ID = 00530, 00551, or 00553, EOD
        Regional Nodes must not = 000, 040, 050, or 999, and EOD Mets must = 00
    d. If Schema ID is in list 4, EOD Regional Nodes must not = 000, 050, 070, or
        999 and EOD Mets must = 00
    e. If Schema ID is in list 7, EOD Regional Nodes must not = 000, 700, 987, or 999


6. If Summary Stage = 4 (regional by direct extension and lymph nodes)
    a. If Schema ID = 00480, EOD Primary Tumor must not = 000, 800, or 999 and
        EOD Regional Nodes must not = 000, 030, 050, 070, or 999 and EOD Mets must
        = 00 or 05
    b. If Schema ID = 00553, EOD Primary Tumor must not = 000, 050, 070,
        080, 800, or 999 and EOD Regional Nodes must not = 000, 050, or 999, and
        EOD Mets must = 00
    c. If Schema ID = 00530 or 00551, EOD Primary Tumor must not = 000, 050, 800, or
        999 and EOD Regional Nodes must not = 000, 050, or 999 and EOD Mets must = 00
    d. If Schema ID is in list 1, EOD Primary Tumor must not = 000, 050, 800, or
        999 and EOD Regional Nodes must not = 000 or 999, and EOD Mets must = 00
    e. If Schema ID is in list 2, EOD Primary Tumor must not = 000, 800, or 999
        and EOD Regional Nodes must not = 000 or 999, and EOD Mets must = 00
    f. If Schema ID is in list 3, EOD Primary Tumor must not = 000, 800, or 999
        and EOD Regional Nodes must not = 000, 040, 050, or 999 and EOD Mets must = 00
    g. If Schema ID is in list 4, EOD Primary Tumor must not = 000, 800, or 999
        and EOD Regional Nodes must not = 000, 050, 070, or 999, and EOD Mets must
         = 00
    h. If Schema ID is in list 5, EOD Primary Tumor must not = 800 or 999 and EOD
        Regional Nodes must not = 000 or 999 and EOD Mets must = 00
    i. If Schema ID is in list 6, EOD Primary Tumor must not = 800 or 999 and
        EOD Regional Nodes must not = 000, 050, or 999 and EOD Mets must = 00
    j. If Schema ID = 00458, EOD Primary Site must not = 800 or 999 and EOD
        Regional Nodes must not = 000, 700, or 999

7. If Schema ID - 00060, Summary Stage must not = 1, 2, or 4.

8. If Schema ID = 00721, 00722, 00723, 09721, 09722, 09723, 09724, 00790, or 00795, Summary Stage must not = 3 or 4.

9. If EOD Mets = 10-70, or if Schema ID = 00370 and EOD Mets = 05, or if Schema ID = 00458 and EOD Regional Nodes = 700,
    Summary Stage 2018 must = 7.

10. If Schema ID = 00790 or 00795
    If Summary Stage 2018 = 1, EOD Primary Tumor must = 100 or 200.
    If Summary Stage 2018 = 2, EOD Primary Tumor must = 300, 400, or 500.
    If Summary Stage 2018 = 7, EOD Primary Tumor must = 575, 600, 700, 750, or 800.


        LIST 1: EOD Primary Tumor with in situ codes 000, 050, regional nodes code
                000
        00190     Appendix [8th: 2018-2022]
        09190     Appendix [V9: 2023+]
        00570     Penis
        00610     Kidney Renal Pelvis
        00620     Bladder
        00631     Urethra
        00633     Urethra Prostatic
        00750     Parathyroid

        LIST 2: EOD Primary Tumor with situ code 000, regional nodes code 000
        00071     Lip
        00072     Tongue Anterior
        00073     Gum
        00074        Floor of Mouth
        00075     Palate Hard
        00076     Buccal Mucosa
        00077     Mouth Other
        00080        Major Salivary Gland
        00090     Nasopharynx
        00100        Oropharynx HPV-Mediated (p16+)
        00111        Oropharynx p16-
        00112        Hypopharynx
        00118     Pharynx Other
        00119        Middle Ear
        00121        Maxillary Sinus
        00122        Nasal Cavity and Ethmoid Sinus
        00128        Sinus Other
        00130        Larynx Other
        00131     Larynx Supraglottic
        00132     Larynx Glottic
        00133     Larynx Subglottic
        00140     Melanoma Head and Neck
        00150        Cutaneous Carcinoma Head and Neck
        00161        Esophagus Squamous
        00169        Esophagus
        00170        Stomach
        00180        Small Intestine
        00200        Colon and Rectum
        00210        Anus [8th: 2018-2022]
        09210        Anus [V9: 2023+]
        00220        Liver
        00230        Bile Ducts Intrahepatic
        00241        Gallbladder
        00242        Cystic Duct
        00250        Bile Ducts Perihilar
        00260        Bile Duct Distal
        00270        Ampulla of Vater
        00278        Biliary Other
        00280        Pancreas
        00288        Digestive Other
        00290        NET Stomach [8th: 2018-2023]
        09290        NET Stomach [V9: 2024+]
        00301        NET Duodenum [8th: 2018-2023]
        09301        NET Duodenum [V9: 2024+]
        00302        NET Ampulla of Vater [8th: 2018-2023]
        09302        NET Ampulla of Vater [V9: 2024+]
        00310        NET Jejunum and Ileum [8th: 2018-2023]
        09310        NET Jejunum and Ileum [V9: 2024+]
        00320        NET Appendix [8th: 2018-2023]
        09320        NET Appendix [V9: 2024+]
        00330        NET Colon and Rectum [8th: 2018-2023]
        09330        NET Colon and Rectum [V9: 2024+]
        00340        NET Pancreas [8th: 2018-2023]
        09340        NET Pancreas [V9: 2024+]
        00350        Thymus
        00358        Trachea
        00360        Lung
        00370        Pleural Mesothelioma
        00378        Respiratory Other
        00430        GIST
        00460        Merkel Cell Skin
        00470        Melanoma Skin
        00478        Skin Other
        00558        Adnexa Uterine Other
        00559        Genital Female Other
        00560        Placenta
        00590        Testis
        00598        Genital Male Other
        00600        Kidney Parenchyma
        00638        Urinary Other
        00640        Skin Eyelid
        00650        Conjunctiva
        00660        Melanoma Conjunctiva
        00671        Melanoma Iris
        00672        Melanoma Choroid and Ciliary Body
        00690        Lacrimal Gland
        00698        Lacrimal Sac
        00700        Orbital Sarcoma
        00718        Eye Other
        00760        Adrenal Gland
        00770        NET Adrenal
        00778        Endocrine Other

    LIST 3: EOD Primary Tumor with in situ code 000, regional nodes codes 000, 050
        00500        Vulva[8th: 2018-2023]
        09500        Vulva [V9: 2024+] [regional nodes codes 000 and 040]
        00510        Vagina
        00520        Cervix [8th: 2018-2020]
        09520        Cervix [9th: 2021+]
        00552        Primary Peritoneal Carcinoma

    LIST 4: EOD Primary Tumor with in situ code 000, regional nodes codes 000, 050,070
        00730        Thyroid
        00740        Thyroid Medullary

    LIST 5: EOD Primary Tumor with no in situ code
        00381        Bone Appendicular Skeleton
        00382        Bone Spine
        00383        Bone Pelvis
        00400        Soft Tissue Head and Neck
        00410        Soft Tissue Trunk and Extremities
        00421        Soft Tissue Abdomen and Thorax
        00422        Heart, Mediastinum, Pleura
        00440        Retroperitoneum
        00450        Soft Tissue Rare
        00459        Soft Tissue Other
        00680        Retinoblastoma
        00710        Lymphoma Ocular Adnexa
        00811        Mycosis Fungoides
        00812        Primary Cutaneous Lymphoma

    LIST 6: EOD Primary Tumor with no in situ code, regional nodes codes 000, 050
        00528        Cervix Sarcoma
        00541        Corpus Sarcoma
        00542        Corpus Adenosarcoma

    LIST 7: EOD Primary Tumor with no in situ code, EOD Regional Nodes coded,
              EOD Mets = 88
        00458        Kaposi Sarcoma
        00822     Plasma Cell Disorder (EOD Regional Nodes code 987 = NA)

    LIST 8: EOD Primary Tumor with no in situ code, EOD Regional Nodes = 888,
             EOD Mets coded
        00721        Brain [8th: 2018-2022]
        09721        Brain [V9: 2023+]
        00722        CNS Other [8th: 2018-2022]
        09722        CNS Other [V9: 2023+]
        09724        Medulloblastoma [V9: 2023+]

    LIST 9:  EOD Primary Tumor with no in situ code, EOD Regional Nodes
           with no code 000, EOD Mets

        00060        Cervical Nodes, Unknown Primary

    LIST 10: EOD Primary Tumor with no in situ code, EOD Regional Nodes = 888,
              EOD Mets = 88
        00790        Lymphoma
        00795        Lymphoma (CLL/SLL)
        00821        Plasma Cell Myeloma
        00830        HemeRetic
        99999     Ill-Defined]]></description>
            <history>
                <event version="SE21-021-04" user="beverung" date="2021-03-16" ref="68583">Edit created.</event>
                <event version="SE21-021-04" user="kirbyk" date="2021-05-14" ref="68669">Fixing lists of valid values.</event>
                <event version="SE22-022-01" user="beverung" date="2022-02-07" ref="68810">Update/add description and logic for Schema IDs 00528, 00530, 00060, 00450 and 00459.</event>
                <event version="SE23-023-01" user="secristc" date="2023-02-06" ref="69136">Update/add description and logic for Schema IDs 09190, 09210, 09721, 09722 and 09724.</event>
                <event version="SE23-023-02" user="cooki" date="2023-04-12" ref="69220">Update/add description and logic for sections 2d, 4d, and 10.</event>
                <event version="SE23-023-04" user="cooki" date="2023-05-30" ref="69261">Updated lists for Schema ID 00370.</event>
                <event version="SE24-024-01" user="shearerw" date="2024-03-18" ref="69424">Added EOD regional node 040 to condition 5 and new schemas to lists 2 and 3.</event>
                <event version="SE24-024-06" user="shearerw" date="2024-07-12" ref="69488">Added logic for EOD regional node values 040 and 700 for multiple Summary Stage values.</event>
            </history>
        </rule>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy