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

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

There is a newer version: 024-13
Show newest version
        <rule id="IFN6296" name="EOD Regional Nodes, Merkel Cell, Reg Nodes Positive, Scope Nodes (SEER)" tag="N6296" java-path="lines.line" category="inter-field" depends="Year_of_Diagnosis">
            <expression><![CDATA[if (line.dateOfDiagnosisYear == null || line.dateOfDiagnosisYear < '2021' || line.typeOfReportingSource == '7' || line.eodRegionalNodes == null)
    return true
if (line.schemaId == null || line.schemaId != '00460')
    return true

if (line.eodRegionalNodes == '100') {
    if (line.rxSummScopeRegLnSur != null && !['0','9'].contains(line.rxSummScopeRegLnSur))
        return false
    if (line.regionalNodesPositive != null && !['98','99'].contains(line.regionalNodesPositive))
        return false
}
else if (line.eodRegionalNodes == '200') {
    if (line.rxSummScopeRegLnSur != null && line.rxSummScopeRegLnSur != '1')
        return false
    if (line.regionalNodesPositive != null && line.regionalNodesPositive != '95')
        return false
}
else if (line.eodRegionalNodes == '300') {
    if (line.rxSummScopeRegLnSur != null && !['2','6','7'].contains(line.rxSummScopeRegLnSur))
        return false
    if (line.regionalNodesPositive != null && !Functions.matches(line.regionalNodesPositive, /^0[1-9]|[1-8]\d|9[07]$/))
        return false
}
else if (line.eodRegionalNodes == '350') {
    if (line.regionalNodesPositive != null && !Functions.matches(line.regionalNodesPositive, /^0[1-9]|[1-8]\d|9[07]$/))
        return false
    if (line.typeOfReportingSource == '6') {
        if (line.rxSummScopeRegLnSur != '0')
            return false
    }
    else {
        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)) {
            if (!Functions.matches(line.rxSummScopeRegLnSur, /^[03-7]$/))
                return false
        }
        else if (!Functions.matches(line.rxSummScopeRegLnSur, /^[3-7]$/))
            return false
    }
}
else if (['400','500','750'].contains(line.eodRegionalNodes)) {
    if (line.regionalNodesPositive != null && !Functions.matches(line.regionalNodesPositive, /^0[1-9]|[1-8]\d|9[057]$/))
        return false
    if (line.typeOfReportingSource == '6') {
        if (line.rxSummScopeRegLnSur != '0')
            return false
    }
    else {
        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)) {
            if (!Functions.matches(line.rxSummScopeRegLnSur, /^[0-7]$/))
                return false
        }
        else if (!Functions.matches(line.rxSummScopeRegLnSur, /^[1-7]$/))
            return false
    }
}
else if (['600','700'].contains(line.eodRegionalNodes) && line.regionalNodesPositive != null && !['00','98','99'].contains(line.regionalNodesPositive))
    return false
else if (line.eodRegionalNodes == '650' && line.regionalNodesPositive != null && !['00','95','97','98','99'].contains(line.regionalNodesPositive))
    return false

if (['700','750'].contains(line.eodRegionalNodes)) {
    if (line.typeOfReportingSource == '6') {
        if (line.reasonForNoSurgery != '9')
            return false
    }
    else {
        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)) {
            if (!Functions.matches(line.reasonForNoSurgery, /^[0-25-9]$/))
                return false
        }
        else if (line.reasonForNoSurgery != '0')
            return false
    }
}
return true]]></expression>
            <message>EOD Regional Nodes/Reg Nodes Pos/Scope conflict for Merkel Cell</message>
            <description><![CDATA[This edit verifies that EOD Regional Nodes is coded consistently with RX Summ--
Scope Reg LN Sur and Regional Nodes Positive for Schema ID 00460, Merkel Cell.

1. The edit is skipped for the following conditions:
    a. Date of Diagnosis before 2021, blank (unknown), or invalid.
    b. Schema ID is blank or not 00460
    c. EOD Regional Nodes is blank
    d. Type of Reporting Source is 7 (Death Certificate Only)


2. If EOD Regional Nodes = 100 (clinical only without biopsy or resection),
    RX Summ--Scope Reg LN Sur if not blank must = 0 or 9 (no nodal procedure
   or unknown if nodal procedure) and
   Regional Nodes Positive if not blank must = 98 or 99

3. If EOD Regional Nodes = 200 (clinical only with core biopsy, FNA),
    RX Summ--Scope Reg LN Sur if not blank must = 1 (biopsy or aspiration of
   regional nodes) and Regional Nodes Positive if not blank must = 95

4. If EOD Regional Nodes = 300 (pathological only, positive on sentinel node
   biopsy),
    RX Summ--Scope Reg LN Sur if not blank must = 2, 6-7 and
    Regional Nodes Positive if not blank must = 01-90, 97

5. If EOD Regional Nodes = 350 (pathological only, positive on resection),
    a. Regional Nodes Positive if not blank must = 01-90, 97
    b. If Type of Reporting Source = 6 (autopsy only) then RX Summ--Scope Reg LN Sur must =0
    Else if vital Status = 0 and Date of Last Contact within 5 months of Date of Diagnosis then RX Summ--Scope Reg LN Sur must = 0,3-7
    Else RX Summ--Scope Reg LN Sur must = 3-7

6. If EOD Regional Nodes = 400, 500, or 750 (pathological with lymph node
    metastasis),
    a. Regional Nodes Positive if not blank must = 01-90, 95, or 97
    b. If Type of Reporting Source = 6 (autopsy only) then RX Summ--Scope Reg LN Sur must =0
    Else if vital Status = 0 and Date of Last Contact within 5 months of Date of Diagnosis then RX Summ--Scope Reg LN Sur must = 0-7
    Else RX Summ--Scope Reg LN Sur must = 1-7

7. If EOD Regional Nodes = 600 (clinical in transit met without lymph node
    metastasis or unknown ) or 700 (pathologic in transit met without lymph node
    metastasis or unknown)
    Regional Nodes Positive if not blank must = 00, 98, or 99

8. If EOD Regional Nodes = 650 (clinical only)
    Regional Nodes Positive if not blank must = 00, 95, 97, 98, or 99

9. If EOD Regional Nodes = 700 or 750 (pathologic in transit mets)
    If Type of Reporting Source = 6 (autopsy only) then Reason for No Surgery must =9
    Else if vital Status = 0 and Date of Last Contact within 5 months of Date of Diagnosis then Reason for No Surgery must = 0-2, 5-9
    Else Reason for No Surgery must = 0]]></description>
            <history>
                <event version="SE21-021-04" user="beverung" date="2021-04-28" ref="68607">Edit created.</event>
                <event version="SE22-022-01" user="beverung" date="2022-01-20" ref="68897">Update edit name to match new NAACCR translated edit.</event>
                <event version="SE22-022-01" user="beverung" date="2022-01-26" ref="68785">Update RX Summ-Scope Reg LN Sur conditions.</event>
                <event version="SE22-022-05" user="kirbyk" date="2022-05-17" ref="68995">Replaced non-ASCII characters in description.</event>
                <event version="SE22-022-08" user="secristc" date="2022-06-23" ref="69011">Updated error message.</event>
                <event version="SE23-023-01" user="secristc" date="2023-02-22" ref="69187">Added 97 as valid value for Regional Nodes Positive when EOD Nodes = 650.</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>
            </history>
        </rule>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy