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

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

There is a newer version: 024-13
Show newest version
        <rule id="IFN6363" name="Regional Nodes Examined, RX Summ--Scope Reg LN Sur (NAACCR)" tag="N6363" java-path="lines.line" category="inter-field" depends="Year_of_Diagnosis">
            <expression><![CDATA[if (line.dateOfDiagnosisYear == null || line.dateOfDiagnosisYear < '2021' || line.regionalNodesExamined == null)
    return true
if (line.rxSummScopeRegLnSur == null || line.typeOfReportingSource == '7')
    return true

if (['00790', '00795', '00822', '00830', '99999'].contains(line.schemaId) && !Functions.matches(line.primarySite, /^C42[0134]|C589|C7[012]\d|C75[123]|C76[1-8]|C77\d|C809$/)
    && Functions.matches(line.rxSummScopeRegLnSur, /^\d$/))
    return true

if (line.rxSummScopeRegLnSur == '0') {
    Integer dolcYear = Functions.asInt(line.dateOfLastContactYear)
    Integer dolcMonth = Functions.asInt(line.dateOfLastContactMonth)
    Integer dolcDay = Functions.asInt(line.dateOfLastContactDay)
    Integer dxYear = Functions.asInt(line.dateOfDiagnosisYear)
    Integer dxMonth = Functions.asInt(line.dateOfDiagnosisMonth)
    Integer dxDay = Functions.asInt(line.dateOfDiagnosisDay)

    if ((line.vitalStatus == '0' && (Boolean)((Closure)Context.compareDatesWithinMonths).call(dolcYear, dolcMonth, dolcDay, dxYear, dxMonth, dxDay, 5)) || line.typeOfReportingSource == '6')
        return Functions.matches(line.regionalNodesExamined, /^[0-8]\d|9[078]$/)

    else
        return line.regionalNodesExamined == '00'
}
else if (line.rxSummScopeRegLnSur == '1' && line.regionalNodesExamined != '95')
    return false
else if (line.rxSummScopeRegLnSur == '2' && !Functions.matches(line.regionalNodesExamined, /^[0-8]\d|9[05-8]$/))
    return false
else if (line.rxSummScopeRegLnSur == '3' && !Functions.matches(line.regionalNodesExamined, /^00|9[678]$/))
    return false
else if (line.rxSummScopeRegLnSur == '4' && !Functions.matches(line.regionalNodesExamined, /^0[123]$/))
    return false
else if (line.rxSummScopeRegLnSur == '5' && !Functions.matches(line.regionalNodesExamined, /^0[4-9]|[1-8]\d|9[0678]$/))
    return false
else if (['6','7'].contains(line.rxSummScopeRegLnSur) && !Functions.matches(line.regionalNodesExamined, /^0[1-9]|[1-8]\d|9[0678]$/))
    return false
else if (line.rxSummScopeRegLnSur == '9' && line.regionalNodesExamined != '99')
    return false
return true]]></expression>
            <message>RX Summ--Scope Reg LN Sur conflicts with Regional Nodes Examined</message>
            <description><![CDATA[This edit checks that Regional Nodes Examined is coded consistently with RX
Summ--Scope Reg LN Sur.

1. This edit is skipped for any of the following conditions:
    a. Diagnosis date is pre-2021, blank (unknown), or invalid
    b. Regional Nodes Examined is blank
    c. RX Summ--Scope Reg LN Sur is blank
    d. Type of Reporting Source = 7 (Death Certificate Only)

2. If Schema ID = 00790, 00795, 00822, 00830, or 99999, and Primary Site not = C420, C421, C423, C424, C589,
    C700-C709, C710-C729, C751-C753, C761-C768, C770-C779, or C809
    If RX Summ--Scope Reg LN Sur = 0-9, the edit passes.

3. If RX Summ--Scope Reg LN Sur = 0 (no nodal procedure performed)
    A. then if Vital Status = 0 and Date of Last Contact <= 5 months from Date of Diagnosis,
    or Type of Reporting Source = 6 (Autopsy Only), then Regional Nodes Examined must = 00-90, 96,97,98.
    B. For all other cases, Regional Nodes Examined must = 00 (no nodes examined)

4. If RX Summ--Scope Reg LN Sur = 1 (biopsy or aspiration of lymph node only)
    Regional Nodes Examined must = 95 (aspiration or core biopsy of regional nodes
performed)

5. If RX Summ--Scope Reg LN Sur = 2 (sentinel node procedure performed)
    Regional Nodes Examined must = 00-90, 95, 96, 97, 98

6. If RX Summ--Scope Reg LN Sur = 6-7 (sentinel node procedure performed
    with regional lymph node dissection)
    Regional Nodes Examined must = 01-90, 96, 97, 98

7. If RX Summ--Scope Reg LN Sur = 3 (number of lymph nodes removed not stated)
    Regional Nodes Examined must = 00, 96, 97, or 98

8. If RX Summ--Scope Reg LN Sur = 4 (1-3 regional nodes removed)
    Regional Nodes Examined must = 01, 02, or 03

9. If RX Summ--Scope Reg LN Sur = 5 (4 or more regional nodes removed)
    Regional Nodes Examined must = 04-90, 96, 97, 98

10. If RX Summ--Scope Reg LN Sur = 9 (unknown whether nodal procedure performed)
    Regional Nodes Examined must = 99 (unknown if nodes removed or examined)]]></description>
            <history>
                <event version="SE21-021-04" user="beverung" date="2021-03-31" ref="68636">Edit created.</event>
                <event version="SE21-021-06" user="beverung" date="2021-06-10" ref="68681">Added skip condition for Type of Reporting Source = 6 (Autopsy only)</event>
                <event version="SE22-022-01" user="secristc" date="2022-02-14" ref="68796">Updated skip conditions, changed logic for RX Summ Scope Reg LN Sur = 0</event>
                <event version="SE22-022-05" user="kirbyk" date="2022-05-17" ref="68995">Replaced non-ASCII characters in description.</event>
                <event version="SE23-023-03" user="shearerw" date="2023-05-24" ref="69216">Fix logic for DOLC within 5 months of DX date to allow difference in year.</event>
                <event version="SE24-024-06" user="shearerw" date="2024-07-03" ref="69484">Add logic to pass edit for certain Schema ID and Primary Site combinations.</event>
            </history>
        </rule>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy