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

com.imsweb.validation.edits.translated.naaccr.NaaccrTranslatedCompiledRules9.groovy Maven / Gradle / Ivy

package com.imsweb.validation.edits.translated.naaccr

import com.imsweb.validation.functions.MetafileContextFunctions
import com.imsweb.validation.runtime.CompiledRules
import groovy.transform.CompileStatic

@CompileStatic
class NaaccrTranslatedCompiledRules9 implements CompiledRules {

    @Override
    public String getValidatorId() {
        return 'naaccr-translated'
    }

    @Override
    public String getValidatorVersion() {
        return 'NAACCR-011-01'
    }

    @Override
    public Map>> getMethodParameters() {
        return [
            'untrimmedlines' : [Binding.class, Map.class, MetafileContextFunctions.class, List.class],
            'untrimmedlines.untrimmedline' : [Binding.class, Map.class, MetafileContextFunctions.class, List.class, Map.class]
        ]
    }

    @Override
    public boolean containsRuleId(String id) {
        return 'NAACCR-02255' <= id && id <= 'NAACCR-02544'
    }

    // ID: NAACCR-02255; TAG: N3969; NAME: Reason for No Radiation, PhI Radiation Treatment Modality (NAACCR)
    public boolean naaccr02255(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "0099", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02256; TAG: N3972; NAME: Summary Stage 2018, Date of DX (SEER)
    public boolean naaccr02256(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.summaryStage2018))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018 must be blank for cases diagnosed before 2018')
        }
        return true

    }

    // ID: NAACCR-02257; TAG: N3974; NAME: Oncotype Dx Risk Level-DCIS, Breast, Behavior (NAACCR)
    public boolean naaccr02257(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "6", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "6", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02258; TAG: N3975; NAME: Oncotype Dx Risk Level-Invasive, Breast, Behavior (NAACCR)
    public boolean naaccr02258(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        functions.GEN_NOOP()
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "6", 1) == 0)
                return false
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorCodeIcdO3, "3") == 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "6") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02259; TAG: N3976; NAME: RX Date Surgery, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02259(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02260; TAG: N3977; NAME: RX Date Radiation, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02260(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02261; TAG: N3978; NAME: RX Date Chemo, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02261(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02262; TAG: N3979; NAME: RX Date Hormone, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02262(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02263; TAG: N3980; NAME: RX Date BRM, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02263(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02264; TAG: N3981; NAME: RX Date Other, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02264(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02265; TAG: N3982; NAME: RX Date Systemic, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02265(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic) && functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic) && !functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag)) {
            if (functions.GEN_AT(untrimmedline.rxDateSystemicFlag, "10111215", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Date Systemic Flag must = 10, 11, or 12')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateSystemic) && !functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag))
            return false
        return true

    }

    // ID: NAACCR-02266; TAG: N3106; NAME: EOD--Old 4 digit (SEER IF264DIG_P1)
    public boolean naaccr02266(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.eodOld4Digit, "(((\\s\\s)|(\\d\\d))((\\s)|(\\d))((\\s)|(\\d)))")

    }

    // ID: NAACCR-02267; TAG: N3973; NAME: TNM Edition Number, Date of Diagnosis (CCCR)
    public boolean naaccr02267(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (dx_year > 2017 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "203658", 2) != 0 || functions.GEN_AT(untrimmedline.ajccId, "48.148.2", 4) != 0)) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "000888", 2) == 0)
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2018+, then TNM Edition Number must = 00, 08, or 88')
        }
        return true

    }

    // ID: NAACCR-02268; TAG: N3970; NAME: Date of Sentinel Lymph Node Biopsy, Schema ID, Date DX (SEER)
    public boolean naaccr02268(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsy) || !functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Date of Sentinel Lymph Node Biopsy and Date of Sentinel Lymph Node Biopsy Flag must be blank for cases diagnosed before 2018')
            }
        }
        functions.GEN_STRCPY(ID, "00470 00480 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (dx_year > 2017) {
        
            if (functions.GEN_AT(code, ID, 6) != 0) {
                if (functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsy) && functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsyFlag))
                    return functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis 2018+ and Schema ID: ${untrimmedline.schemaId}, either Date of Sentinel Lymph Node Biopsy or Date of Sentinel Lymph Node Biopsy Flag must be reported.')
            }
        }
        return true

    }

    // ID: NAACCR-02269; TAG: N3971; NAME: Sentinel Lymph Nodes Pos/Ex, Schema ID, Date DX (SEER)
    public boolean naaccr02269(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        functions.GEN_NOOP()
        
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || !functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Lymph Nodes Examined and Sentinel Lymph Nodes Positive must be blank for cases diagnosed before 2018')
            }
        }
        functions.GEN_STRCPY(ID, "00470 00480 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined) || functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesPositive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Sentinel Lymph Nodes Examined and Sentinel Lymph Nodes Positive must be reported for Melanoma of Skin and Breast')
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6", 1) != 0) {
                if (functions.GEN_AT(untrimmedline.sentinelLymphNodesExamined, "00") == 0 || functions.GEN_AT(untrimmedline.sentinelLymphNodesPositive, "98") == 0)
                    return functions.GEN_ERROR_MSG(binding, 'Conflict between Sentinel Lymph Nodes Examined: ${untrimmedline.sentinelLymphNodesExamined}, Sentinel Lymph Nodes Positive: ${untrimmedline.sentinelLymphNodesPositive}, and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6", 1) != 0) {
                if (functions.GEN_AT(untrimmedline.sentinelLymphNodesExamined, "99") == 0 || functions.GEN_AT(untrimmedline.sentinelLymphNodesPositive, "99") == 0)
                    return functions.GEN_ERROR_MSG(binding, 'Conflict between Sentinel Lymph Nodes Examined: ${untrimmedline.sentinelLymphNodesExamined}, Sentinel Lymph Nodes Positive: ${untrimmedline.sentinelLymphNodesPositive}, and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
        }
        return true

    }

    // ID: NAACCR-02270; TAG: N3988; NAME: SEER Site-Specific Fact 1, Date DX (SEER)
    public boolean naaccr02270(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFact1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'SEER Site-Specific Fact 1 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFact1))
            return true
        if (functions.GEN_AT(untrimmedline.seerSiteSpecificFact1, "0123456789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.seerSiteSpecificFact1} not valid code for SEER Site-Specific Fact 1')
        return true

    }

    // ID: NAACCR-02271; TAG: N3989; NAME: SEER Site-Specific Fact 1, Schema ID, Required (SEER)
    public boolean naaccr02271(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[70]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00100 00111 00112 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFact1))
                return false
        }
        return true

    }

    // ID: NAACCR-02272; TAG: N3990; NAME: SSDI for Breast, Blank for Other Schemas (NAACCR)
    public boolean naaccr02272(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00480") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercntPosOrRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Percent Pos or Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Total Allred Score must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IhcSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 IHC Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Dual Probe Copy Number must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Dual Probe Ratio must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Single Probe Copy Number must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.her2IshSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 ISH Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, LN Positive Axillary Level I-II must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Multigene Signature Method must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Multigene Signature Results must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Recurrence Score-DCIS must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasiv)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Recurrence Score-Invasive must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Risk Level-DCIS must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Oncotype Dx Risk Level-Invasive must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepPrcntPosOrRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Recept Percent Pos or Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Receptor Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepTotalAllredScor)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Receptor Total Allred Score must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Response to Neoadjuvant Therapy must be blank')
                err_flag = 1
            }
            if (dx_year >= 2018 && dx_year <= 2020) {
        
                if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary)) {
                    functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 Overall Summary must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.ki67)) {
                    functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Ki-67 must be blank')
                    err_flag = 1
                }
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02273; TAG: N3991; NAME: SSDI for Prostate, Blank for Other Schemas (NAACCR)
    public boolean naaccr02273(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00580") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Patterns Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Patterns Pathological must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Score Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonScorePathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Score Pathological must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Gleason Tertiary Pattern must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Number of Cores Examined must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, Number of Cores Positive must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.psaLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, PSA Lab Value must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02274; TAG: N3992; NAME: SSDI for Testis, Blank for Other Schemas (NAACCR)
    public boolean naaccr02274(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00590") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Post-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Post-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Pre-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, AFP Pre-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Post-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Post-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Pre-Orchiectomy Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, hCG Pre-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, LDH Post-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, LDH Pre-Orchiectomy Range must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.sCategoryClinical)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, S Category Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.sCategoryPathological)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Testis, S Category Pathological must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02275; TAG: N3993; NAME: SSDI for Kidney, Blank for Other Schemas (NAACCR)
    public boolean naaccr02275(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00600") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Invasion Beyond Capsule must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolve)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Ipsilateral Adrenal Gland Involvement must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Major Vein Involvement must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Kidney, Sarcomatoid Features must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02276; TAG: N3994; NAME: SSDI for Liver & Biliary, Blank for Other Schemas (NAACCR)
    public boolean naaccr02276(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00220 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, AFP Pretreatment Interpretation must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, AFP Pretreatment Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretxTotalLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Bilirubin Pretreatment Total Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretxUnitOfMeasure)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Bilirubin Pretreatment Unit of Measure must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Creatinine Pretreatment Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.creatininePretxUnitOfMeasure)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Creatinine Pretreatment Unit of Measure must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.iNRProthrombinTime)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver, Internatl Norm Ratio Prothrombin Time must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00220 00230 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver or Intrehepatic Bile Duct, Fibrosis Score must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00230 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Intrahepatic Bile Duct, Tumor Growth Pattern must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00230 00250 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Intrahep,Perihilar Duct, Prim Scleros Cholang must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02277; TAG: N3995; NAME: SSDI for Head & Neck, Blank for Other Schemas (NAACCR)
    public boolean naaccr02277(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] ID = new char[70]
        char[] IDPlus1 = new char[140]
        char[] IDPlus2 = new char[150]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00100 00111 00112 ")
        
        functions.GEN_STRCPY(IDPlus1, ID)
        functions.GEN_STRCAT(IDPlus1, "00060 00080 00090 00121 00122 00131 00132 00133 00130 00140 ")
        
        functions.GEN_STRCPY(IDPlus2, IDPlus1)
        functions.GEN_STRCAT(IDPlus2, "00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00060 00140 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Levels I-III must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Levels IV-V must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Levels VI-VII must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cerv Nodes,Melanoma H&N, LN H&N Other must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, ID, 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFact1)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N, SEER Site-Specific Fact 1 must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, IDPlus1, 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckClin)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N, Extranodal Extension H&N Clinical must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N, Extranodal Extension H&N Pathological must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, IDPlus2, 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not H&N or SCC of H&N, LN Size must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02278; TAG: N3996; NAME: SSDI for Esophagus, Blank for Other Schemas (NAACCR)
    public boolean naaccr02278(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00161") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00161") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Esophagus (Squam), Esophagus,EGJ Tumor Epicenter must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02279; TAG: N3997; NAME: SSDI for Appendix & Colorectal, Blank for Other Schemas (NAACCR)
    public boolean naaccr02279(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00190 00200 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Appendix,Colorectal, CEA Pretreat Interpretation must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Appendix,Colorectal, CEA Pretreat Lab Value must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00200 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.brafMutationalAnalysis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, BRAF Mutational Analysis must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, Circumferential Resection Margin must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.kras)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, KRAS must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, Microsatellite Instability (MSI) must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.nrasMutationalAnalysis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, NRAS Mutational Analysis must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tumorDeposits)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colon & Rectum, Tumor Deposits must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02280; TAG: N3998; NAME: SSDI for Lung & Pleura, Blank for Other Schemas (NAACCR)
    public boolean naaccr02280(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.alkRearrangement)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lung, ALK Rearrangement must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.egfrMutationalAnalysis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lung, EGFR Mutational Analysis must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.separateTumorNodules)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lung, Separate Tumor Nodules must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.visceralParietalPleuralInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lung, Visceral and Parietal Pleural Invasion must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00370") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.pleuralEffusion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Pleural Mesothelioma, Pleural Effusion must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02281; TAG: N3999; NAME: SSDI for Bone, Blank for Other Schemas (NAACCR)
    public boolean naaccr02281(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00381 00382 00383 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Bone, Percent Necrosis Post Neoadjuvant must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02282; TAG: N4000; NAME: SSDI for Soft Tissue, Blank for Other Schemas (NAACCR)
    public boolean naaccr02282(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        char[] code = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00400 00410 00421 00422 00440 00450 00459 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.boneInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Soft Tissue, Bone Invasion must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02283; TAG: N4001; NAME: SSDI for GIST, Blank for Other Schemas (NAACCR)
    public boolean naaccr02283(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00430") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00430") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not GIST, KIT Gene Immunohistochemistry must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02284; TAG: N4002; NAME: SSDI for Skin, Blank for Other Schemas (NAACCR)
    public boolean naaccr02284(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00150") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cutaneous SCC H&N, High Risk Histologic Features must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00460") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Merkel Cell, LN Isolated Tumor Cells (ITC) must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Merkel Cell, Profound Immune Suppression must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00470") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Breslow Tumor Thickness must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, LDH Lab Value must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, LDH Upper Limits of Normal must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Mitotic Rate Melanoma must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ulceration)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Ulceration must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02285; TAG: N4003; NAME: SSDI for Vulva, Vagina, Cervix, Blank for Other Schemas (NAACCR)
    public boolean naaccr02285(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00500 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnLaterality)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva, LN Laterality must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "09520 ") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.p16)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Cervix 9th Edtion, p16 must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00500 00510 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnStatusFemoralInguinal)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva or Vagina,LN Status: Femoral-Inguinal must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00500 00510 00520 09520 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessMethodFemoralInguinal)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva or Vagina, LN Assess Meth Femoral-Inguinal must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessMethodParaaortic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vagina or Cervix, LN Assess Method Para-aortic must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnAssessMethodPelvic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva, Vagina, or Cervix, LN Assess Method Pelvic must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnStatusPelvic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vulva, Vagina, or Cervix, LN Status: Pelvic must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00510 00520 09520 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.lnDistantAssessMethod)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vagina or Cervix, LN Distant Assessment Method must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vagina, or Cervix, LN Distant: Mediastinal, Scalene must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lnStatusParaAortic)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Vagina or Cervix, LN Status: Para-Aortic must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02286; TAG: N4004; NAME: SSDI for Corpus Uteri, Blank for Other Schemas (NAACCR)
    public boolean naaccr02286(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00528 00530 00541 00542 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number Pos Para-Aortic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number Exam Para-Aortic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number of Positive Pelvic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Number of Examined Pelvic Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.peritonealCytology)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Corpus Uteri, Peritoneal Cytology must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02287; TAG: N4005; NAME: SSDI for Ovary, Fallopian Tube, Primary Peritoneal, Blank for Other Schemas (NAACCR)
    public boolean naaccr02287(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00551 00552 00553 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Ovarian, CA-125 Pretreatment Interpretation must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.residualTumVolPostCytoreduction)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Ovarian, Residual Tumor Volume Post Cytoreduction must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02288; TAG: N4006; NAME: SSDI for Placenta, Blank for Other Schemas (NAACCR)
    public boolean naaccr02288(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00560") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00560") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPxIndex)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Placenta, Gest Trophoblast Prognost Scoring Ind must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02289; TAG: N4007; NAME: SSDI for Ophthalmic Melanoma, Blank for Other Schemas (NAACCR)
    public boolean naaccr02289(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00660 00671 00672 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.measuredThickness)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Ophthalmic Melanoma, Measured Thickness must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00671 00672 ") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome3Status)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Chromosome 3 Status must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome8qStatus)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Chromosome 8q Status must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Extravascular Matrix Patterns must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Measured Basal Diameter must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.microvascularDensity)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Microvascular Density must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Uveal Melanoma, Mitotic Count Uveal Melanoma must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02290; TAG: N4008; NAME: SSDI for Retinoblastoma, Blank for Other Schemas (NAACCR)
    public boolean naaccr02290(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00680") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00680") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.heritableTrait)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Retinoblastoma, Heritable Trait must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02291; TAG: N4009; NAME: SSDI for Lacrimal Gland, Blank for Other Schemas (NAACCR)
    public boolean naaccr02291(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00690") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00690") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lacrimal Gland, Adenoid Cystic Basaloid Pattern must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02292; TAG: N4010; NAME: SSDI for Brain, CNS, Blank for Other Schemas (NAACCR)
    public boolean naaccr02292(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00721 00722 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Brain Molecular Markers must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossHeterozygosity)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Chromosome 1p: Loss of Heterozygosity must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossHeterozygosity)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Chromosome 19q: Loss of Heterozygosity must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MGMT)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Methylat O6-Methylguanine-Methyltransf must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02293; TAG: N4011; NAME: SSDI for Lymphoma, Blank for Other Schemas (NAACCR)
    public boolean naaccr02293(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00790 00795 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.bSymptoms)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma, B Symptoms must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.hivStatus)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma, HIV Status must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma, NCCN International Prognostic Index must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(code, "00795 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.adenopathy)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Adenopathy must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.anemia)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Anemia must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.lymphocytosis)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Lymphocytosis must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.organomegaly)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Organomegaly must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.thrombocytopenia)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Thrombocytopenia must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.derivedRaiStage)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Lymphoma CLL/SLL, Derived RAI Stage must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02294; TAG: N4012; NAME: SSDI for Plasma Cell Myeloma, Blank for Other Schemas (NAACCR)
    public boolean naaccr02294(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00821") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00821", 5) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Myeloma, High Risk Cytogenetics must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Myeloma, Serum Albumin Pretreatment Level must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretxLvl)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Myeloma, Serum Beta-2 Microglob Pretreat Level must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02295; TAG: N4013; NAME: SSDI for HemeRetic, Blank for Other Schemas (NAACCR)
    public boolean naaccr02295(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00830") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00830") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.jak2)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not HemeRetic, JAK2 must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02296; TAG: N4014; NAME: SSDI Perineural Invasion, Blank for Other Schemas (NAACCR)
    public boolean naaccr02296(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00150 00200 00640 00690 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.perineuralInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not CutH&N,Colorect,SkinEyelid,LacGland, Perineur Inv must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02297; TAG: N4015; NAME: SSDI Extranodal Extension non-H&N, Blank for Other Schemas (NAACCR)
    public boolean naaccr02297(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00460 00570 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not Merkel Cell,Penis, Extranodal Extens Clin (non-H&N) must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not Merkel Cell,Penis, Extranodal Extens Path (non-H&N) must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02298; TAG: N4016; NAME: SSDI LDH Level, Blank for Other Schemas (NAACCR)
    public boolean naaccr02298(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00470 00821 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema not Melanoma of Skin or Myeloma, LDH Level must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02299; TAG: N4017; NAME: SSDI FIGO Stage, Blank for Other Schemas (NAACCR)
    public boolean naaccr02299(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00500 00510 00520 00528 00530 00541 00542 00551 00552 00553 00560 09520 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.figoStage)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Gynecologic, FIGO Stage must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02300; TAG: N4018; NAME: SSDI for Mycosis Fungoides, Blank for Other Schemas (NAACCR)
    public boolean naaccr02300(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00811") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00811") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Mycosis Fungoides, Peripheral Blood Involvement must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02301; TAG: N3987; NAME: TNM Edition Number, AJCC ID (COC)
    public boolean naaccr02301(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "XX") != 0) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") == 0)
                return false
        }
        if (dx_year >= 2022) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "XX") == 0 && !functions.GEN_EMPTY(untrimmedline.ajccId)) {
                if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Edition Number must not = 88 for AJCC ID: ${untrimmedline.ajccId}')
            }
        }
        return true

    }

    // ID: NAACCR-02302; TAG: N2665; NAME: Chromosome 3 Status, Date DX (NAACCR)
    public boolean naaccr02302(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome3Status))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 3 Status must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.chromosome3Status))
            return true
        if (functions.GEN_AT(untrimmedline.chromosome3Status, "0123789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.chromosome3Status} not valid code for Chromosome 3 Status')
        return true

    }

    // ID: NAACCR-02303; TAG: N4019; NAME: Lymphovascular Invasion, Schema ID (NAACCR)
    public boolean naaccr02303(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31]
        
        int dx_year
        char[] ID1 = new char[385]
        char[] ID2 = new char[200]
        char[] code = new char[7]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.NAACCR_GEN_RIGHT)))
        
        
        functions.GEN_STRCPY(ID1, "00071 00072 00073 00074 00075 00076 00077 00080 00111 00112 ")
        functions.GEN_STRCAT(ID1, "00121 00122 00130 00131 00132 00133 00161 00169 00170 00180 ")
        functions.GEN_STRCAT(ID1, "00190 00200 00301 00302 00320 00340 00460 00470 00530 00541 ")
        functions.GEN_STRCAT(ID1, "00542 00570 00590 00620 00500 00510 00520 00560 ")
        functions.GEN_STRCAT(ID1, "00100 00230 00250 00260 00270 00280 00290 00330 00350 00360 ")
        functions.GEN_STRCAT(ID1, "09520 00528 ")
        
        
        functions.GEN_STRCPY(ID2, "00710 00790 00795 00811 00812 00821 00822 00830 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID1, 6) != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "012349", 1) == 0) {
                functions.GEN_SAVE_TEXT(binding, name)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Schema ID = ${untrimmedline.schemaId}, Lymphovascular Invasion must not = 8')
            }
        }
        if (dx_year >= 2018 && dx_year <= 2020) {
            if (functions.GEN_AT(code, "00730 00740 ") != 0) {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "012349", 1) == 0) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Schema ID = ${untrimmedline.schemaId}, Lymphovascular Invasion must not = 8')
                }
            }
            if (functions.GEN_AT(code, "00760 ") != 0) {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
        }
        if (dx_year >= 2021) {
            if (functions.GEN_AT(code, "00730 00740 00760 ", 6) != 0) {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "02349", 1) == 0) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Schema ID = ${untrimmedline.schemaId}, Lymphovascular Invasion must not = 1 or 8')
                }
            }
        }
        if (functions.GEN_AT(code, ID2, 6) != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8", 1) == 0) {
                functions.GEN_SAVE_TEXT(binding, name)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Schema ID = ${untrimmedline.schemaId}, Lymphovascular Invasion must = 8')
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00430") != 0) {
            if (dx_year <= 2020) {
                if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) != 0)
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
            }
            else {
                if (dx_year >= 2018) {
                    if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
                        return true
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
        }
        if (functions.GEN_AT(code, ID2, 6) == 0 && functions.GEN_AT(code, ID1, 6) == 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0) {
                functions.GEN_SAVE_TEXT(binding, name)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Lymphovascular Invasion: ${untrimmedline.lymphVascularInvasion} not valid for Schema ID: ${untrimmedline.schemaId}')
            }
        }
        return true

    }

    // ID: NAACCR-02304; TAG: N2958; NAME: Measured Basal Diameter, Schema ID, Required (NAACCR)
    public boolean naaccr02304(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[14]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter) || functions.GEN_AT(untrimmedline.measuredBasalDiameter, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02305; TAG: N2959; NAME: Measured Thickness, Schema ID, Required (NAACCR)
    public boolean naaccr02305(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        char[] ID = new char[20]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00660 00671 00672 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.measuredThickness) || functions.GEN_AT(untrimmedline.measuredThickness, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02306; TAG: N4900; NAME: Summary Stage 2018, Schema ID (NAACCR)
    public boolean naaccr02306(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31], SS2018 = new char[2]
        
        int dx_year
        
        
        char[] group_SS2018 = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ID ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.NAACCR_GEN_RIGHT)))
        
        functions.GEN_STRCPY(group_SS2018, untrimmedline.schemaId)
        functions.GEN_STRCAT(group_SS2018, untrimmedline.summaryStage2018)
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SUMST2018, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SUMST2018_SCHEMA_IDSS2018, group_SS2018, ['SCHEMA_ID':SCHEMA_ID, 'SS2018':SS2018])) {
            functions.GEN_SAVE_TEXT(binding, name)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018: ${untrimmedline.summaryStage2018} not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: NAACCR-02307; TAG: N4901; NAME: AJCC TNM Path, AJCC TNM Clin (COC)
    public boolean naaccr02307(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "08") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathN))
            return true
        char[] t_code = new char[16]
        char[] n_code = new char[16]
        
        functions.GEN_STRCPY(t_code, functions.GEN_TRIM(untrimmedline.ajccTnmPathT, ((Integer)context.NAACCR_GEN_RIGHT)))
        functions.GEN_STRCPY(n_code, functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.NAACCR_GEN_RIGHT)))
        
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT)) {
            if (functions.GEN_STRCMP(t_code, "c", 1) == 0 && functions.GEN_STRCMP(untrimmedline.ajccTnmClinT, "c", 1) == 0) {
                if (functions.GEN_STRCMP(t_code, functions.GEN_TRIM(untrimmedline.ajccTnmClinT, ((Integer)context.NAACCR_GEN_RIGHT))) != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin and Path categories must be equal when "c" prefix assigned to both categories')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN)) {
            if (functions.GEN_STRCMP(n_code, "c", 1) == 0 && functions.GEN_STRCMP(untrimmedline.ajccTnmClinN, "c", 1) == 0) {
                if (functions.GEN_STRCMP(n_code, functions.GEN_TRIM(untrimmedline.ajccTnmClinN, ((Integer)context.NAACCR_GEN_RIGHT))) != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM Clin and Path categories must be equal when "c" prefix assigned to both categories')
            }
        }
        return true

    }

    // ID: NAACCR-02308; TAG: N4902; NAME: TNM Clin Staged By, Date of Diagnosis (COC)
    public boolean naaccr02308(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2015 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStagedBy))
                return false
        }
        return true

    }

    // ID: NAACCR-02309; TAG: N4903; NAME: TNM Items, DX Post 2017 (NAACCR)
    public boolean naaccr02309(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Clin Descriptor must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathT)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path T must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path N must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathM)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path M must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path Stage Group must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX >2017, TNM Path Descriptor must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02310; TAG: N4904; NAME: Derived EOD 2018, Date of DX (SEER)
    public boolean naaccr02310(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedEod2018T) || !functions.GEN_EMPTY(untrimmedline.derivedEod2018N) || !functions.GEN_EMPTY(untrimmedline.derivedEod2018M) || !functions.GEN_EMPTY(untrimmedline.derivedEod2018StageGroup))
                return false
        }
        return true

    }

    // ID: NAACCR-02311; TAG: N4905; NAME: RX Date Mst Defn Srg, Date Flag, Date DX, CoC Flag (SEER)
    public boolean naaccr02311(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
                return false
        }
        return true

    }

    // ID: NAACCR-02312; TAG: N4906; NAME: Summary Stage 2000, Date of Diagnosis (SEER)
    public boolean naaccr02312(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year == 2016 || dx_year == 2017) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) && functions.GEN_EMPTY(untrimmedline.derivedSs2000))
                return functions.GEN_ERROR_MSG(binding, 'If Year of Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()}, then either SEER Summary Stage 2000 or Derived SS2000 must not be blank')
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis >= 2018, then SEER Summary Stage 2000 must be blank')
        }
        return true

    }

    // ID: NAACCR-02313; TAG: N4907; NAME: AJCC TNM, TNM Edition Number, AJCC ID (SEER)
    public boolean naaccr02313(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber)) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'IF TNM Edition Number = blank, all AJCC TNM data items must be blank')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0809", 2) != 0) {
            if ((functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70,48.1,48.2,71,72,75,") && !functions.GEN_INLIST(untrimmedline.ajccId, "79.0,79.1,79.2,79.3,79.4,79.5,79.6,79.7,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,82,83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83,")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 08 or 09, AJCC TNM fields must indicate staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinM, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'if TNM Edition Number = 88, AJCC TNM fields must indicate no staging applicable')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "99") || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "99")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinM, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 00, all AJCC TNM fields must indicate no staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "09") != 0) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "52") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Edition Number: ${untrimmedline.tnmEditionNumber} is valid only for AJCC ID 53, Cervix Uteri')
        }
        return true

    }

    // ID: NAACCR-02314; TAG: N4909; NAME: Lymphovascular Invasion (SEER)
    public boolean naaccr02314(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0)
            return false
        return true

    }

    // ID: NAACCR-02315; TAG: N4910; NAME: Derived Summary Stage 2018, Schema ID (SEER)
    public boolean naaccr02315(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31], SS2018 = new char[2]
        
        int dx_year
        
        
        char[] group_SS2018 = new char[10]
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.NAACCR_GEN_RIGHT)))
        
        functions.GEN_STRCPY(group_SS2018, untrimmedline.schemaId)
        functions.GEN_STRCAT(group_SS2018, untrimmedline.derivedSummaryStage2018)
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SUMST2018, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SUMST2018_SCHEMA_IDSS2018, group_SS2018, ['SCHEMA_ID':SCHEMA_ID, 'SS2018':SS2018])) {
            functions.GEN_SAVE_TEXT(binding, name)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Derived Summary Stage 2018: ${untrimmedline.derivedSummaryStage2018} not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: NAACCR-02316; TAG: N4911; NAME: Histologic Type ICDO3, Primary Site, Date of Diagnosis (NAACCR)
    public boolean naaccr02316(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Group = new char[2], SITE_LOW = new char[5], SITE_HIGH = new char[5], HISTO_USE = new char[5], NOT_USE = new char[5]
        
        char[] SITE_USE = new char[15]
        char[] SITE_NO = new char[15]
        char[] message = new char[100]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year < 2018 || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (dx_year >= 2018) {
        
            if (functions.GEN_AT(untrimmedline.primarySite, "C739") != 0) {
                if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8510") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} is not valid for Primary Site: ${untrimmedline.primarySite} for Date of Diagnosis >= 2018')
            }
            if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8550", 4) != 0) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} is not valid for Primary Site: ${untrimmedline.primarySite} for Date of Diagnosis >= 2018')
            }
        }
        if (dx_year >= 2019) {
            if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8253825482568257", 4) != 0) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} is not valid for Primary Site: ${untrimmedline.primarySite} for Date of Diagnosis >= 2019')
            }
            if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9150") != 0) {
                if (functions.GEN_AT(untrimmedline.gradeClinical, "4") != 0 || functions.GEN_AT(untrimmedline.gradePathological, "4") != 0) {
                    return true
                }
            }
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SOLID_TUMOR_RULES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SOLID_TUMOR_RULES_SITE_LOW, untrimmedline.primarySite, ['GROUP':Group, 'SITE_LOW':SITE_LOW, 'SITE_HIGH':SITE_HIGH, 'HISTO_USE':HISTO_USE, 'NOT_USE':NOT_USE])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, SITE_LOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITE_HIGH) <= 0) {
                    functions.GEN_STRCPY(SITE_USE, SITE_LOW)
                    functions.GEN_STRCAT(SITE_USE, SITE_HIGH)
                    functions.GEN_STRCAT(SITE_USE, untrimmedline.histologicTypeIcdO3)
        
                    functions.GEN_STRCPY(SITE_NO, SITE_LOW)
                    functions.GEN_STRCAT(SITE_NO, SITE_HIGH)
                    functions.GEN_STRCAT(SITE_NO, untrimmedline.histologicTypeIcdO3)
                }
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SOLID_TUMOR_RULES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SOLID_TUMOR_RULES_SITE_LOWSITE_HIGHHISTO_USE, SITE_USE, ['GROUP':Group, 'SITE_LOW':SITE_LOW, 'SITE_HIGH':SITE_HIGH, 'HISTO_USE':HISTO_USE, 'NOT_USE':NOT_USE])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITE_LOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITE_HIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTO_USE) == 0)
                        return true
                    else {
                        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SOLID_TUMOR_RULES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SOLID_TUMOR_RULES_SITE_LOWSITE_HIGHNOT_USE, SITE_NO, ['GROUP':Group, 'SITE_LOW':SITE_LOW, 'SITE_HIGH':SITE_HIGH, 'HISTO_USE':HISTO_USE, 'NOT_USE':NOT_USE])) {
                            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITE_LOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITE_HIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, NOT_USE) == 0) {
                                functions.GEN_STRCPY(message, HISTO_USE)
                                functions.GEN_STRCAT(message, " is preferred over ")
                                functions.GEN_STRCAT(message, NOT_USE)
                                functions.GEN_STRCAT(message, " for ")
                                functions.GEN_STRCAT(message, untrimmedline.primarySite)
                                if (functions.GEN_AT(Group, "1") != 0)
                                    functions.GEN_SAVE_TEXT(binding, message)
                                else {
                                    if (functions.GEN_AT(Group, "2") != 0)
                                        return false
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-02317; TAG: N4912; NAME: Grade Path, Grade Post Therapy, Post Therapy Stage (NAACCR)
    public boolean naaccr02317(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0088", 2) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00790007950081100812008210082200830", 5) != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") == 0)) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological must = 9 if AJCC TNM Post Therapy Path (yp) Stage Group is not blank and AJCC TNM Post Therapy Path (yp) T not blank and not = 88')
            if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Path (yp) Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
        }
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.NAACCR_GEN_RIGHT)), "ypT0") != 0 && functions.GEN_AT(untrimmedline.ajccId, "48.148.2", 4) == 0) {
            if (functions.GEN_AT(untrimmedline.gradePostTherapy, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Path (yp) T: ${untrimmedline.ajccTnmPostTherapyT}')
        }
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0)) {
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} and AJCC TNM Post Therapy Path (yp) Stage Group: ${untrimmedline.ajccTnmPostTherapyStageGroup}')
        }
        return true

    }

    // ID: NAACCR-02319; TAG: N4914; NAME: Grade Path, Grade Post Therapy (NAACCR)
    public boolean naaccr02319(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00790007950081100812008210082200830", 5) != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02323; TAG: N3967; NAME: NPCR Derived AJCC 8 TNM, Date of Diagnosis (NPCR)
    public boolean naaccr02323(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2020) {
            if (!functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmClinStgGrp) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPathStgGrp) || !functions.GEN_EMPTY(untrimmedline.npcrDerivedAjcc8TnmPostStgGrp))
                return false
        }
        return true

    }

    // ID: NAACCR-02324; TAG: N2828; NAME: Radiation Phases, Date DX (COC)
    public boolean naaccr02324(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.numberPhasesOfRadTxToVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.totalDose))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Total Dose must be reported for diagnosis date 2018+')
            if (functions.GEN_EMPTY(untrimmedline.radiationTxDiscontinuedEarly))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Radiation Treatment Discontinued Early must be reported for diagnosis date 2018+')
        }
        return true

    }

    // ID: NAACCR-02325; TAG: N4918; NAME: PhI, II, III Radiation Primary Treatment Volume (COC)
    public boolean naaccr02325(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume) && functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume) && functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTxVolume} conflicts with Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTxVolume} conflicts with Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume} conflicts with Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTxVolume}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume} conflicts with Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTxVolume}')
        }
        return true

    }

    // ID: NAACCR-02326; TAG: N4921; NAME: TNM Edition Number (SEER)
    public boolean naaccr02326(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "000102030405060708098899U7", 2) == 0)
            return false
        return true

    }

    // ID: NAACCR-02327; TAG: N2565; NAME: Reason for No Radiation, PhI, II, III Radiation (COC)
    public boolean naaccr02327(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "01-99"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "00") != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)))
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "0099", 2) != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "0099", 2) != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "0099", 2) != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)))
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "99") != 0 && (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)))
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLN, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase1DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase1NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase1TotalDose, "999999") != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "99") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02328; TAG: N2562; NAME: Number of Phases of Radiation, PhI, II, III Radiation Phase (COC)
    public boolean naaccr02328(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        char[] radiation_msg = new char[100]
        
        if (functions.GEN_EMPTY(untrimmedline.numberPhasesOfRadTxToVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume))
            return true
        if (functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "00") != 0 && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberPhasesOfRadTxToVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTxVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTxVolume}')
        }
        if (functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "01", 2) != 0) {
            if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "01-99") && (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) && (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "00") != 0 || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)))
                return true
            else {
                functions.GEN_STRCPY(radiation_msg, "Phase I radiation items are coded if 1 phase given")
                functions.GEN_SAVE_TEXT(binding, radiation_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberPhasesOfRadTxToVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTxVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTxVolume}')
            }
        }
        if (functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "02", 2) != 0) {
            if ((functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "01-99") && functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTxVolume, "01-99") && functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "00") != 0) || functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume))
                return true
            else {
                functions.GEN_STRCPY(radiation_msg, "Phase I and II radiation items are coded if 2 phases given")
                functions.GEN_SAVE_TEXT(binding, radiation_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberPhasesOfRadTxToVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTxVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTxVolume}')
            }
        }
        if (functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "0304", 2) != 0) {
            if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "01-99") && functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTxVolume, "01-99") && functions.GEN_INLIST(untrimmedline.phase3RadiationPrimaryTxVolume, "01-99"))
                return true
            else {
                functions.GEN_STRCPY(radiation_msg, "Phase I, II, and III radiation items are coded if 3 or 4 phases given")
                functions.GEN_SAVE_TEXT(binding, radiation_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Phases of Rad Treatment to This Volume: ${untrimmedline.numberPhasesOfRadTxToVolume} conflicts with Phase I Radiation Primary Treatment Volume: ${untrimmedline.phase1RadiationPrimaryTxVolume}, Phase II Radiation Primary Treatment Volume: ${untrimmedline.phase2RadiationPrimaryTxVolume}, and Phase III Radiation Primary Treatment Volume: ${untrimmedline.phase3RadiationPrimaryTxVolume}')
            }
        }
        return true

    }

    // ID: NAACCR-02329; TAG: N4917; NAME: Phase I Radiation (COC)
    public boolean naaccr02329(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume))
            return true
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "00") != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00") != 0) && functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "00") != 0 && functions.GEN_AT(untrimmedline.radiationTxDiscontinuedEarly, "00") != 0 && functions.GEN_AT(untrimmedline.totalDose, "000000") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00") == 0 || functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLN, "00") == 0 || functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamTech, "00") == 0 || functions.GEN_AT(untrimmedline.phase1DosePerFraction, "00000") == 0 || functions.GEN_AT(untrimmedline.phase1NumberOfFractions, "000") == 0 || functions.GEN_AT(untrimmedline.phase1TotalDose, "000000") == 0 || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "00", 2) == 0 || functions.GEN_AT(untrimmedline.radiationTxDiscontinuedEarly, "00") == 0 || functions.GEN_AT(untrimmedline.totalDose, "000000") == 0)
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "01-98")) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98") || !functions.GEN_INLIST(untrimmedline.phase1RadiationToDrainingLN, "00-08, 88, 99") || !functions.GEN_INLIST(untrimmedline.phase1RadiationExternalBeamTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase1DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase1NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase1TotalDose, "000001-999999") || !functions.GEN_INLIST(untrimmedline.numberPhasesOfRadTxToVolume, "01-04,99") || !functions.GEN_INLIST(untrimmedline.radiationTxDiscontinuedEarly, "01-99") || !functions.GEN_INLIST(untrimmedline.totalDose, "000001-999999"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "99", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase1RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase1DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase1NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase1TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "99") != 0 && functions.GEN_AT(untrimmedline.radiationTxDiscontinuedEarly, "99") != 0 && functions.GEN_AT(untrimmedline.totalDose, "999999") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationToDrainingLN, "99") != 0 && functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase1DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase1NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase1TotalDose, "999999") != 0 && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "99") != 0 && functions.GEN_AT(untrimmedline.radiationTxDiscontinuedEarly, "99") != 0 && functions.GEN_AT(untrimmedline.totalDose, "999999") != 0)
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98") || !functions.GEN_INLIST(untrimmedline.phase1RadiationToDrainingLN, "00-08,99") || !functions.GEN_INLIST(untrimmedline.phase1RadiationExternalBeamTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase1DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase1NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase1TotalDose, "000001-999999") || !functions.GEN_INLIST(untrimmedline.numberPhasesOfRadTxToVolume, "01-04,99") || !functions.GEN_INLIST(untrimmedline.radiationTxDiscontinuedEarly, "01-99") || !functions.GEN_INLIST(untrimmedline.totalDose, "000001-999999"))
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-02330; TAG: N4919; NAME: Phase II Radiation (COC)
    public boolean naaccr02330(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase2RadiationPrimaryTxVolume)) {
            if ((functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "0099", 2) != 0) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "000199", 2) != 0)
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "00", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00") != 0) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "0001", 2) != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00") == 0 || functions.GEN_AT(untrimmedline.phase2RadiationToDrainingLN, "00") == 0 || functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamTech, "00") == 0 || functions.GEN_AT(untrimmedline.phase2DosePerFraction, "00000") == 0 || functions.GEN_AT(untrimmedline.phase2NumberOfFractions, "000") == 0 || functions.GEN_AT(untrimmedline.phase2TotalDose, "000000") == 0 || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "0001", 2) == 0)
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.phase2RadiationPrimaryTxVolume, "01-98")) {
            if (!functions.GEN_INLIST(untrimmedline.phase2RadiationTreatmentModality, "01-16,98") || !functions.GEN_INLIST(untrimmedline.phase2RadiationToDrainingLN, "00-08, 88, 99") || !functions.GEN_INLIST(untrimmedline.phase2RadiationExternalBeamTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase2DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase2NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase2TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "02030499", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationPrimaryTxVolume, "99", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase2RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase2DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase2NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase2TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "99") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase2RadiationToDrainingLN, "99") != 0 && functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase2DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase2NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase2TotalDose, "999999") != 0 && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "99") != 0)
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.phase2RadiationTreatmentModality, "01-16,98") || !functions.GEN_INLIST(untrimmedline.phase2RadiationToDrainingLN, "00-08,99") || !functions.GEN_INLIST(untrimmedline.phase2RadiationExternalBeamTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase2DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase2NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase2TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "02030499", 2) == 0)
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-02331; TAG: N4920; NAME: Phase III Radiation (COC)
    public boolean naaccr02331(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase3RadiationPrimaryTxVolume)) {
            if ((functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "0099", 2) != 0) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "00010299", 2) != 0)
                return true
            else
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "00", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "00") != 0) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "000102", 2) != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "00") == 0 || functions.GEN_AT(untrimmedline.phase3RadiationToDrainingLN, "00") == 0 || functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamTech, "00") == 0 || functions.GEN_AT(untrimmedline.phase3DosePerFraction, "00000") == 0 || functions.GEN_AT(untrimmedline.phase3NumberOfFractions, "000") == 0 || functions.GEN_AT(untrimmedline.phase3TotalDose, "000000") == 0 || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "000102", 2) == 0)
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.phase3RadiationPrimaryTxVolume, "01-98")) {
            if (!functions.GEN_INLIST(untrimmedline.phase3RadiationTreatmentModality, "01-16,98") || !functions.GEN_INLIST(untrimmedline.phase3RadiationToDrainingLN, "00-08, 88, 99") || !functions.GEN_INLIST(untrimmedline.phase3RadiationExternalBeamTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase3DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase3NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase3TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "030499", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.phase3RadiationPrimaryTxVolume, "99", 2) != 0) {
            if ((functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality) || functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "99") != 0) && functions.GEN_EMPTY(untrimmedline.phase3RadiationToDrainingLN) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase3DosePerFraction) && functions.GEN_EMPTY(untrimmedline.phase3NumberOfFractions) && functions.GEN_EMPTY(untrimmedline.phase3TotalDose) && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "99") != 0)
                return true
            else {
                if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "99") != 0 && functions.GEN_AT(untrimmedline.phase3RadiationToDrainingLN, "99") != 0 && functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamTech, "99") != 0 && functions.GEN_AT(untrimmedline.phase3DosePerFraction, "99999") != 0 && functions.GEN_AT(untrimmedline.phase3NumberOfFractions, "999") != 0 && functions.GEN_AT(untrimmedline.phase3TotalDose, "999999") != 0 && functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "99") != 0)
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.phase3RadiationTreatmentModality, "01-16,98") || !functions.GEN_INLIST(untrimmedline.phase3RadiationToDrainingLN, "00-08,99") || !functions.GEN_INLIST(untrimmedline.phase3RadiationExternalBeamTech, "01-10, 88, 98") || !functions.GEN_INLIST(untrimmedline.phase3DosePerFraction, "00001-99999") || !functions.GEN_INLIST(untrimmedline.phase3NumberOfFractions, "001-999") || !functions.GEN_INLIST(untrimmedline.phase3TotalDose, "000001-999999") || functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "030499", 2))
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-02332; TAG: N4928; NAME: PhI, II, III Radiation Treatment Modality (SEER)
    public boolean naaccr02332(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality) && functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality)) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation Treatment Modality: ${untrimmedline.phase1RadiationTreatmentModality} conflicts with Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality)) {
            if (functions.GEN_EMPTY(untrimmedline.phase2RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationTreatmentModality, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationTreatmentModality, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase3RadiationTreatmentModality))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation Treatment Modality: ${untrimmedline.phase2RadiationTreatmentModality} conflicts with Phase III Radiation Treatment Modality: ${untrimmedline.phase3RadiationTreatmentModality}')
        }
        return true

    }

    // ID: NAACCR-02333; TAG: N4929; NAME: Surgery, Phase I Rad, Surg/Rad Seq (SEER)
    public boolean naaccr02333(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int result
        int dx_year
        int seer_init_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90", "(\\d\\d)") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98", "(\\d\\d)") && dx_year >= 2018 && dx_year <= 2020) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && dx_year >= 2021)) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00", "(\\d\\d)") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1") && dx_year >= 2021)) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00", "(\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-02334; TAG: N4930; NAME: AJCC TNM Items, Type Reporting Source-DCO (NAACCR)
    public boolean naaccr02334(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) == 0)
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin T: ${untrimmedline.ajccTnmClinT} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin N: ${untrimmedline.ajccTnmClinN} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin M: ${untrimmedline.ajccTnmClinM} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmClinStageGroup, 2), "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin Stage Group: ${untrimmedline.ajccTnmClinStageGroup} must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Clin N Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path T: ${untrimmedline.ajccTnmPathT} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path N: ${untrimmedline.ajccTnmPathN} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path M: ${untrimmedline.ajccTnmPathM} must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPathStageGroup, 2), "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path Stage Group: ${untrimmedline.ajccTnmPathStageGroup} must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Path N Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyClinT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Clin (yc) N must equal 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyClinN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Clin (yc) M must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyClinM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Clin (yc) Stage Group must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinStageGrp))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Clin (yc) T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Clin (yc) N Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Type of Reporting Source9 must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyT, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Path (yp) T must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyN, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Path (yp) N must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyM, 2), "88") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Path (yp) M must = 88 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && functions.GEN_AT(functions.GEN_LEFT(untrimmedline.ajccTnmPostTherapyStageGroup, 2), "8899", 2) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Path (yp) Stage Group must = 88, 99, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Path (yp) T Suffix must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: AJCC TNM Post Therapy Path (yp) N Suffix must = blank')
        return true

    }

    // ID: NAACCR-02335; TAG: N4931; NAME: SSDI, DCO (NAACCR)
    public boolean naaccr02335(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.adenoidCysticBasaloidPattern) && functions.GEN_AT(untrimmedline.adenoidCysticBasaloidPattern, "XXX.8XXX.9", 5) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Adenoid Cystic Basaloid Pattern must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.adenopathy) && functions.GEN_AT(untrimmedline.adenopathy, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Adenopathy must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue) && functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.8XXXXX.9", 7) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Post-Orchiectomy Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange) && functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Post-Orchiectomy Range must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyLabValue) && functions.GEN_AT(untrimmedline.afpPreOrchiectomyLabValue, "XXXXX.8XXXXX.9", 7) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pre-Orchiectomy Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPreOrchiectomyRange) && functions.GEN_AT(untrimmedline.afpPreOrchiectomyRange, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pre-Orchiectomy Range must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentInterpretation) && functions.GEN_AT(untrimmedline.afpPretreatmentInterpretation, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pretreatment Interpretation must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.afpPretreatmentLabValue) && functions.GEN_AT(untrimmedline.afpPretreatmentLabValue, "XXXX.8XXXX.9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: AFP Pretreatment Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.alkRearrangement) && functions.GEN_AT(untrimmedline.alkRearrangement, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: ALK Rearrangement must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.anemia) && functions.GEN_AT(untrimmedline.anemia, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Anemia must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.bSymptoms) && functions.GEN_AT(untrimmedline.bSymptoms, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: B Symptoms must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretxTotalLabValue) && functions.GEN_AT(untrimmedline.bilirubinPretxTotalLabValue, "XXX.8XXX.9", 5) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Bilirubin Pretreatment Total Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.bilirubinPretxUnitOfMeasure) && functions.GEN_AT(untrimmedline.bilirubinPretxUnitOfMeasure, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Bilirubin Pretreatment Unit of Measure must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.boneInvasion) && functions.GEN_AT(untrimmedline.boneInvasion, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Bone Invasion must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.brafMutationalAnalysis) && functions.GEN_AT(untrimmedline.brafMutationalAnalysis, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: BRAF Mutational Analysis must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) && functions.GEN_AT(untrimmedline.brainMolecularMarkers, "8899", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Brain Molecular Markers must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness) && functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Breslow Tumor Thickness must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ca199PretxLabValue) && functions.GEN_AT(untrimmedline.ca199PretxLabValue, "XXXX.8XXXX.9", 6) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: CA19-9 PreTX Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ca125PretreatmentInterpretation) && functions.GEN_AT(untrimmedline.ca125PretreatmentInterpretation, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: CA-125 Pretreatment Interpretation must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ceaPretreatmentInterpretation) && functions.GEN_AT(untrimmedline.ceaPretreatmentInterpretation, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: CEA Pretreatment Interpretation must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossHeterozygosity) && functions.GEN_AT(untrimmedline.chromosome19qLossHeterozygosity, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 19q: Loss of Heterozygosity (LOH) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossHeterozygosity) && functions.GEN_AT(untrimmedline.chromosome1pLossHeterozygosity, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 1p: Loss of Heterozygosity (LOH) must be blank, unknown, or invalid')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome3Status) && functions.GEN_AT(untrimmedline.chromosome3Status, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 3 Status must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome8qStatus) && functions.GEN_AT(untrimmedline.chromosome8qStatus, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Chromosome 8q Status must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin) && functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Circumferential Resection Margin (CRM) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.creatininePretreatmentLabValue) && functions.GEN_AT(untrimmedline.creatininePretreatmentLabValue, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Creatinine Pretreatment Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.creatininePretxUnitOfMeasure) && functions.GEN_AT(untrimmedline.creatininePretxUnitOfMeasure, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Creatinine Pretreatment Unit of Measure must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.egfrMutationalAnalysis) && functions.GEN_AT(untrimmedline.egfrMutationalAnalysis, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: EGFR Mutational Analysis must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter) && functions.GEN_AT(untrimmedline.esophagusAndEgjTumorEpicenter, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Esophagus and EGJ Tumor Epicenter must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercntPosOrRange) && functions.GEN_AT(untrimmedline.estrogenReceptorPercntPosOrRange, "XX8XX9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Percent Positive or Range must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary) && functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorTotalAllredScore) && functions.GEN_AT(untrimmedline.estrogenReceptorTotalAllredScore, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Total Allred Score must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) && functions.GEN_AT(untrimmedline.extranodalExtensionClin, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Clin (non-Head and Neck) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckClin) && functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Head and Neck Clinical must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath) && functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckPath, "X.8X.9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Head and Neck Pathological must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extranodal Extension Path (non-Head and Neck) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.extravascularMatrixPatterns) && functions.GEN_AT(untrimmedline.extravascularMatrixPatterns, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Extravascular Matrix Patterns must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore) && functions.GEN_AT(untrimmedline.fibrosisScore, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Fibrosis Score must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.figoStage) && functions.GEN_AT(untrimmedline.figoStage, "9899", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: FIGO Stage must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gestationalTrophoblasticPxIndex) && functions.GEN_AT(untrimmedline.gestationalTrophoblasticPxIndex, "X9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gestational Trophoblastic Prognostic Scoring Index must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical) && functions.GEN_AT(untrimmedline.gleasonPatternsClinical, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Patterns Clinical must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological) && functions.GEN_AT(untrimmedline.gleasonPatternsPathological, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Patterns Pathological must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonScoreClinical) && functions.GEN_AT(untrimmedline.gleasonScoreClinical, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Score Clinical must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonScorePathological) && functions.GEN_AT(untrimmedline.gleasonScorePathological, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Score Pathological must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) && functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Gleason Tertiary Pattern must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue) && functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.8XXXXX.9", 7) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Post-Orchiectomy Lab Value must be blank, unknown, or invalid')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange) && functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Post-Orchiectomy Range must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyLabValue) && functions.GEN_AT(untrimmedline.hcgPreOrchiectomyLabValue, "XXXXX.8XXXXX.9", 7) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Pre-Orchiectomy Lab Value must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hcgPreOrchiectomyRange) && functions.GEN_AT(untrimmedline.hcgPreOrchiectomyRange, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: hCG Pre-Orchiectomy Range must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IhcSummary) && functions.GEN_AT(untrimmedline.her2IhcSummary, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 IHC Summary must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber) && functions.GEN_AT(untrimmedline.her2IshDualProbeCopyNumber, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Dual Probe Copy Number must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio) && functions.GEN_AT(untrimmedline.her2IshDualProbeRatio, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Dual Probe Ratio must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber) && functions.GEN_AT(untrimmedline.her2IshSingleProbeCopyNumber, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Single Probe Copy Number must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2IshSummary) && functions.GEN_AT(untrimmedline.her2IshSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 ISH Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary) && functions.GEN_AT(untrimmedline.her2OverallSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 Overall Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.heritableTrait) && functions.GEN_AT(untrimmedline.heritableTrait, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Heritable Trait must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.highRiskCytogenetics) && functions.GEN_AT(untrimmedline.highRiskCytogenetics, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: High Risk Cytogenetics must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures) && functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: High Risk Histologic Features must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.hivStatus) && functions.GEN_AT(untrimmedline.hivStatus, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HIV Status must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.iNRProthrombinTime) && functions.GEN_AT(untrimmedline.iNRProthrombinTime, "X.8X.9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: International Normalized Ratio Prothrombin Time must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) && functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Invasion Beyond Capsule must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolve) && functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Ipsilateral Adrenal Gland Involvement must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.jak2) && functions.GEN_AT(untrimmedline.jak2, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: JAK2 must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ki67) && functions.GEN_AT(untrimmedline.ki67, "XXX.8XXX.9", 5) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Ki-67 must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.kitGeneImmunohistochemistry) && functions.GEN_AT(untrimmedline.kitGeneImmunohistochemistry, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: KIT Gene Immunohistochemistry must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.kras) && functions.GEN_AT(untrimmedline.kras, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: KRAS must be blank, unknown, or invalid')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue) && functions.GEN_AT(untrimmedline.ldhPretreatmentLabValue, "XXXXX.8XXXXX.9", 7) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Lab Value must be blank, unknown, or invalid')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLevel) && functions.GEN_AT(untrimmedline.ldhPretreatmentLevel, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Level must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange) && functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Post-Orchiectomy Range) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPreOrchiectomyRange) && functions.GEN_AT(untrimmedline.ldhPreOrchiectomyRange, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Pre-Orchiectomy Range) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhUpperLimitsOfNormal) && functions.GEN_AT(untrimmedline.ldhUpperLimitsOfNormal, "XX8XX9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Upper Limits of Normal must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnAssessMethodFemoralInguinal) && functions.GEN_AT(untrimmedline.lnAssessMethodFemoralInguinal, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Assessment Method Femoral-Inguinal must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnAssessMethodParaaortic) && functions.GEN_AT(untrimmedline.lnAssessMethodParaaortic, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Assessment Method Para-Aortic must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnAssessMethodPelvic) && functions.GEN_AT(untrimmedline.lnAssessMethodPelvic, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Assessment Method Pelvic must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnDistantAssessMethod) && functions.GEN_AT(untrimmedline.lnDistantAssessMethod, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Distant Assessment Method must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) && functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Distant: Mediastinal, Scalene must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3) && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Levels I-III must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5) && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Levels IV-V must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7) && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Levels VI-VII must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther) && functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Head and Neck Other must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) && functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Isolated Tumor Cells (ITC) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnLaterality) && functions.GEN_AT(untrimmedline.lnLaterality, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Laterality must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) && functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Positive Axillary Level I-II must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnSize) && functions.GEN_AT(untrimmedline.lnSize, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Size must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lnStatusFemorInguinParaaortPelv) && functions.GEN_AT(untrimmedline.lnStatusFemorInguinParaaortPelv, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LN Status Femoral-Inguinal, Para-Aortic, Pelvic must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.lymphocytosis) && functions.GEN_AT(untrimmedline.lymphocytosis, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Lymphocytosis must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) && functions.GEN_AT(untrimmedline.majorVeinInvolvement, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Major Vein Involvement must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.measuredBasalDiameter) && functions.GEN_AT(untrimmedline.measuredBasalDiameter, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Measured Basal Diameter must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.measuredThickness) && functions.GEN_AT(untrimmedline.measuredThickness, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Measured Thickness must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MGMT) && functions.GEN_AT(untrimmedline.methylationOfO6MGMT, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Methylation of O6-Methylguanine-Methyltransferase must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability) && functions.GEN_AT(untrimmedline.microsatelliteInstability, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Microsatellite Instability (MSI) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.microvascularDensity) && functions.GEN_AT(untrimmedline.microvascularDensity, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Microvascular Density must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.mitoticCountUvealMelanoma) && functions.GEN_AT(untrimmedline.mitoticCountUvealMelanoma, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Mitotic Count Uveal Melanoma must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.mitoticRateMelanoma) && functions.GEN_AT(untrimmedline.mitoticRateMelanoma, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Mitotic Rate Melanoma must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureMethod) && functions.GEN_AT(untrimmedline.multigeneSignatureMethod, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Multigene Signature Method must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.multigeneSignatureResults) && functions.GEN_AT(untrimmedline.multigeneSignatureResults, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Multigene Signature Results must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.nccnInternationalPrognosticIndex) && functions.GEN_AT(untrimmedline.nccnInternationalPrognosticIndex, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: NCCN International Prognostic Index (IPI) must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.nrasMutationalAnalysis) && functions.GEN_AT(untrimmedline.nrasMutationalAnalysis, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: NRAS Mutational Analysis must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined) && functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Cores Examined must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive) && functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Cores Positive must be blank')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) && functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Examined Para-Aortic Nodes must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) && functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Examined Pelvic Nodes must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) && functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Number of Positive Para-Aortic Nodes must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) && functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Positive Pelvic Nodes must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis) && functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX8XX9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Recurrence Score-DCIS must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreInvasiv) && functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreInvasiv, "XX9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Recurrence Score-Invasive must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis) && functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Risk Level-DCIS must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive) && functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Oncotype Dx Risk Level-Invasive must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.organomegaly) && functions.GEN_AT(untrimmedline.organomegaly, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Organomegaly must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) && functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8XXX.9", 5) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Percent Necrosis Post Neoadjuvant must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.perineuralInvasion) && functions.GEN_AT(untrimmedline.perineuralInvasion, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Perineural Invasion must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.peripheralBloodInvolvement) && functions.GEN_AT(untrimmedline.peripheralBloodInvolvement, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Peripheral Blood Involvemen must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.peritonealCytology) && functions.GEN_AT(untrimmedline.peritonealCytology, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Peritoneal Cytology must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.pleuralEffusion) && functions.GEN_AT(untrimmedline.pleuralEffusion, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Pleural Effusion must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.primarySclerosingCholangitis) && functions.GEN_AT(untrimmedline.primarySclerosingCholangitis, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Primary Sclerosing Cholangitis must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.profoundImmuneSuppression) && functions.GEN_AT(untrimmedline.profoundImmuneSuppression, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Profound Immune Suppression must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepPrcntPosOrRange) && functions.GEN_AT(untrimmedline.progesteroneRecepPrcntPosOrRange, "XX8XX9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Percent Positive or Range must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary) && functions.GEN_AT(untrimmedline.progesteroneRecepSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepTotalAllredScor) && functions.GEN_AT(untrimmedline.progesteroneRecepTotalAllredScor, "XX8XX9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Total Allred Score must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.psaLabValue) && functions.GEN_AT(untrimmedline.psaLabValue, "XXX.9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: PSA (Prostatic Specific Antigen) Lab Value must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.residualTumVolPostCytoreduction) && functions.GEN_AT(untrimmedline.residualTumVolPostCytoreduction, "9899", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Residual Tumor Volume Post Cytoreduction must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.responseToNeoadjuvantTherapy) && functions.GEN_AT(untrimmedline.responseToNeoadjuvantTherapy, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Response to Neoadjuvant Therapy must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.sCategoryClinical) && functions.GEN_AT(untrimmedline.sCategoryClinical, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: S Category Clinical must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.sCategoryPathological) && functions.GEN_AT(untrimmedline.sCategoryPathological, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: S Category Pathological must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.sarcomatoidFeatures) && functions.GEN_AT(untrimmedline.sarcomatoidFeatures, "XX8XX9", 3) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Sarcomatoid Features must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.seerSiteSpecificFact1) && functions.GEN_AT(untrimmedline.seerSiteSpecificFact1, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: SEER Site-Specific Fact 1 must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.separateTumorNodules) && functions.GEN_AT(untrimmedline.separateTumorNodules, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Separate Tumor Nodules must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.serumAlbuminPretreatmentLevel) && functions.GEN_AT(untrimmedline.serumAlbuminPretreatmentLevel, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Serum Albumin Pretreatment Level must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.serumBeta2MicroglobulinPretxLvl) && functions.GEN_AT(untrimmedline.serumBeta2MicroglobulinPretxLvl, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Serum Beta-2 Microglobulin Pretreatment Level must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.thrombocytopenia) && functions.GEN_AT(untrimmedline.thrombocytopenia, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Thrombocytopenia must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.tumorDeposits) && functions.GEN_AT(untrimmedline.tumorDeposits, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Tumor Deposits must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.tumorGrowthPattern) && functions.GEN_AT(untrimmedline.tumorGrowthPattern, "X8X9", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Tumor Growth Pattern must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ulceration) && functions.GEN_AT(untrimmedline.ulceration, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Ulceration must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.visceralParietalPleuralInvasion) && functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "89", 1) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Visceral and Parietal Pleural Invasion must be blank, unknown, or NA')
            err_flag = 1
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02336; TAG: N4022; NAME: RX Summ--Radiation, Date of Diagnosis (NPCR)
    public boolean naaccr02336(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2010 || dx_year > 2017) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummRadiation))
                return false
        }
        if (dx_year > 2014 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummRadiation))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For diagnosis year 2015-2017, RX Summ--Radiation cannot be blank')
        }
        return true

    }

    // ID: NAACCR-02339; TAG: N4026; NAME: Secondary Diagnosis 1, Date DX (COC)
    public boolean naaccr02339(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis1))
            return false
        return true

    }

    // ID: NAACCR-02340; TAG: N4933; NAME: Creatinine Pretreatment Unit of Measure, Schema ID, Required, CoC Flag (SEER)
    public boolean naaccr02340(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00220", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.creatininePretxUnitOfMeasure) || functions.GEN_AT(untrimmedline.creatininePretxUnitOfMeasure, "8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02342; TAG: N4908; NAME: AJCC TNM, TNM Edition Number, AJCC ID, CoC Flag (NPCR)
    public boolean naaccr02342(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0809", 2) != 0) {
            if ((functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70") && !functions.GEN_INLIST(untrimmedline.ajccId, "71,72,75,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88") && !functions.GEN_INLIST(untrimmedline.ajccId, "14,16.3,18.2,38.2,38.3,40,42,45,65,66,67.1,69,70,48.1,48.2,71,72,75") && !functions.GEN_INLIST(untrimmedline.ajccId, "79.0,79.1,79.2,79.3,79.4,79.5,79.6,79.7,81.1,81.2,82.1,82.2,83.0,83.1,83.2,83.3,83.4")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,82,83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,82,83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinT, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinN, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,56,72,79,81-83")) || (functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinM, "88") && !functions.GEN_INLIST(functions.GEN_LEFT(untrimmedline.ajccId, 2), "45,72,79,81-83")))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 08 or 09, AJCC TNM fields must indicate staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88") != 0) {
            if (!functions.GEN_INLIST(untrimmedline.ajccTnmClinT, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinN, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinM, "88") || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "88") || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyM, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinM, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'if TNM Edition Number = 88, AJCC TNM fields must indicate no staging applicable')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "00") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) || !functions.GEN_INLIST(untrimmedline.ajccTnmClinStageGroup, "99") || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPathStageGroup, "99")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyStageGroup, "99")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinT, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinN, "88")) || (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM) && !functions.GEN_INLIST(untrimmedline.ajccTnmPostTherapyClinM, "88")) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix) || !functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If TNM Edition Number = 00, all AJCC TNM fields must indicate no staging assigned')
        }
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "09") != 0) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "52") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Edition Number: ${untrimmedline.tnmEditionNumber} is valid only for AJCC ID 53, Cervix Uteri')
        }
        return true

    }

    // ID: NAACCR-02343; TAG: N4028; NAME: TNM Edition Number, Date of Diagnosis, CoC Flag (NPCR)
    public boolean naaccr02343(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)))
            return true
        if (dx_year < 2018)
            return true
        if (dx_year >= 2018 && dx_year <= 2020 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
        
            if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber) && functions.GEN_AT(untrimmedline.tnmEditionNumber, "000888", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Edition Number must = 00, 08, or 88')
        }
        if (dx_year >= 2021 && functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") != 0) {
        
            if (!functions.GEN_EMPTY(untrimmedline.tnmEditionNumber) && functions.GEN_AT(untrimmedline.tnmEditionNumber, "00080988", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If year of Date of Diagnosis is 2021+, then TNM Edition Number must = 00, 08, 09, or 88')
        }
        return true

    }

    // ID: NAACCR-02344; TAG: N2824; NAME: _SYS Schema ID, Primary Site, Histology (NAACCR)
    public boolean naaccr02344(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[6], GPNAME = new char[31], SCDSCR1 = new char[2], SCDSCR2 = new char[2], YEAR = new char[5]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] SchemaName = new char[35]
        char[] t_schema_msg = new char[100]
        char[] group = new char[5]
        
        char[] SD1 = new char[1]
        char[] SD2 = new char[1]
        
        char[] change_year = new char[1]
        char[] changed = new char[4]
        
        char[] Site_HistLo = new char[20]
        
        char[] Site_Hist_SD = new char[25]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            functions.GEN_STRCPY(SD1, "X")
        if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            functions.GEN_STRCPY(SD1, untrimmedline.schemaDiscriminator1)
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
            functions.GEN_STRCPY(SD2, "X")
        if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2)) {
            functions.GEN_STRCPY(SD2, untrimmedline.schemaDiscriminator2)
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-482, 488", "(C\\d\\d\\d)", 2, 3) && (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8700,8720-8790,8806,8822,8930-8931,8933,8950,8960,8980,9000,9050") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9052,9060,9070-9071,9073,9080,9085,9090-9091,9100,9110,9700-9701"))) {
            functions.GEN_STRCPY(SD1, untrimmedline.sex)
        }
        if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9732", 4) != 0) {
            functions.GEN_STRCPY(SD1, "X")
        }
        if (functions.GEN_AT(untrimmedline.primarySite, "C739", 4) != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9591", 4) == 0) {
            functions.GEN_STRCPY(SD1, "X")
        }
        if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "89358936", 4) != 0)
            functions.GEN_STRCPY(SD1, "X")
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        
        functions.GEN_STRCPY(change_year, "0")
        
        if (functions.GEN_AT(untrimmedline.primarySite, "C530C531C538C539", 4) != 0) {
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_CHANGESCHEMAID, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_CHANGESCHEMAID_HISTLOW, untrimmedline.histologicTypeIcdO3, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2, 'YEAR':YEAR])) {
                if (functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0) {
                    functions.GEN_STRCPY(change_year, "1")
                    if (dx_year >= 2018 && dx_year <= 2020)
                        functions.GEN_STRCPY(changed, "2018")
                    else {
                        if (dx_year >= 2021)
                            functions.GEN_STRCPY(changed, "2021")
                    }
                }
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMAID2018STGP_SITELOW, Site, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2, 'YEAR':YEAR])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
            }
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        else {
            functions.GEN_STRCPY(group, "88888")
            functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
        }
        if (functions.GEN_AT(change_year, "1") != 0) {
        
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOW, Site_HistLo, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2, 'YEAR':YEAR])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0) {
                    functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                    functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                    functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                    functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                    functions.GEN_STRCAT(Site_Hist_SD, SD1)
                    functions.GEN_STRCAT(Site_Hist_SD, SD2)
                    functions.GEN_STRCAT(Site_Hist_SD, changed)
                }
                else {
                    functions.GEN_STRCPY(group, "88888")
                    functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                }
            }
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
            if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOWHISTHIGHSCDSCR1SCDSCR2YEAR, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2, 'YEAR':YEAR])) {
                if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(SD1, SCDSCR1) == 0 && functions.GEN_STRCMP(SD2, SCDSCR2) == 0 && functions.GEN_STRCMP(changed, YEAR) == 0)
                    functions.GEN_STRCPY(group, GPCODE)
                else {
                    functions.GEN_STRCPY(group, "88888")
                    functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                }
            }
            else {
                functions.GEN_STRCPY(group, "88888")
                functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
            }
        }
        else {
            if (functions.GEN_AT(change_year, "1") == 0) {
        
        
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOW, Site_HistLo, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2, 'YEAR':YEAR])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0) {
                        functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                        functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                        functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                        functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                        functions.GEN_STRCAT(Site_Hist_SD, SD1)
                        functions.GEN_STRCAT(Site_Hist_SD, SD2)
                    }
                    else {
                        functions.GEN_STRCPY(group, "88888")
                        functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                    }
                }
                else {
                    functions.GEN_STRCPY(group, "88888")
                    functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                }
                if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMAID2018STGP, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMAID2018STGP_SITELOWSITEHIGHHISTLOWHISTHIGHSCDSCR1SCDSCR2, Site_Hist_SD, ['GPCODE':GPCODE, 'GPNAME':GPNAME, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1, 'SCDSCR2':SCDSCR2, 'YEAR':YEAR])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(SD1, SCDSCR1) == 0 && functions.GEN_STRCMP(SD2, SCDSCR2) == 0)
                        functions.GEN_STRCPY(group, GPCODE)
                    else {
                        functions.GEN_STRCPY(group, "88888")
                        functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                    }
                }
                else {
                    functions.GEN_STRCPY(group, "88888")
                    functions.GEN_STRCPY(GPNAME, "Unknown Schema ID")
                }
            }
        }
        if (functions.GEN_STRCMP(untrimmedline.schemaId, group) != 0) {
            functions.GEN_STRCPY(t_schema_msg, "Calculated Schema ID: ")
            functions.GEN_STRCAT(t_schema_msg, group)
            functions.GEN_STRCAT(t_schema_msg, ", ")
            functions.GEN_STRCAT(t_schema_msg, GPNAME)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Reported Schema ID: ${untrimmedline.schemaId} not valid for ${untrimmedline.primarySite}, ${untrimmedline.histologicTypeIcdO3}/${untrimmedline.behaviorCodeIcdO3}, SD1: ${untrimmedline.schemaDiscriminator1}, SD2: ${untrimmedline.schemaDiscriminator2}, Sex: ${untrimmedline.sex}, DxDate: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        return true

    }

    // ID: NAACCR-02345; TAG: N4200; NAME: PhI Radiation External Beam Planning Tech, Date DX, CoC Flag (SEER)
    public boolean naaccr02345(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (dx_year > 2017) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamTech)) {
                if (functions.GEN_AT(untrimmedline.phase1RadiationTreatmentModality, "0099", 2) != 0)
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02346; TAG: N4201; NAME: PhI, II, III Radiation External Beam Planning Tech, CoC Flag (SEER)
    public boolean naaccr02346(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech) && functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamTech))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech)) {
            if (functions.GEN_EMPTY(untrimmedline.phase1RadiationExternalBeamTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation External Beam Planning Tech: ${untrimmedline.phase1RadiationExternalBeamTech} conflicts with Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase1RadiationExternalBeamTech, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamTech, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase I Radiation External Beam Planning Tech: ${untrimmedline.phase1RadiationExternalBeamTech} conflicts with Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamTech}')
        }
        if (!functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamTech)) {
            if (functions.GEN_EMPTY(untrimmedline.phase2RadiationExternalBeamTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamTech} conflicts with Phase III Radiation External Beam Planning Tech: ${untrimmedline.phase3RadiationExternalBeamTech}')
        }
        if (functions.GEN_AT(untrimmedline.phase2RadiationExternalBeamTech, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.phase3RadiationExternalBeamTech, "00") == 0 && !functions.GEN_EMPTY(untrimmedline.phase3RadiationExternalBeamTech))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Phase II Radiation External Beam Planning Tech: ${untrimmedline.phase2RadiationExternalBeamTech} conflicts with Phase III Radiation External Beam Planning Tech: ${untrimmedline.phase3RadiationExternalBeamTech}')
        }
        return true

    }

    // ID: NAACCR-02347; TAG: N4203; NAME: _SYS AJCC ID, Date of Diagnosis, CoC Flag (SEER)
    public boolean naaccr02347(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ajccId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC ID must be blank for cases diagnosed before 2018')
        }
        if (dx_year >= 2018) {
            if (functions.GEN_EMPTY(untrimmedline.ajccId))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC ID must not be blank for cases diagnosed 2018 and later')
        }
        return true

    }

    // ID: NAACCR-02348; TAG: N4204; NAME: RX Coding System--Current, Date DX (NAACCR)
    public boolean naaccr02348(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year >= 2018) {
            if (functions.GEN_INLIST(untrimmedline.rxCodingSystemCurrent, "08", "(\\d\\d)"))
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-02349; TAG: N4205; NAME: _SYS AJCC ID, Site, Histo, Age (NAACCR)
    public boolean naaccr02349(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] discrim_msg1 = new char[100]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ageAtDiagnosis))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9811-9818,9835-9837") && functions.GEN_AT(untrimmedline.primarySite, "C421") != 0) {
            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-019,999")) {
                if (functions.GEN_AT(untrimmedline.ajccId, "83.2") == 0) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require age at diagnosis to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, discrim_msg1)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}, Age at Diagnosis: ${untrimmedline.ageAtDiagnosis}, Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance. ')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "020-120")) {
                if (functions.GEN_AT(untrimmedline.ajccId, "83.3") == 0) {
                    functions.GEN_STRCPY(discrim_msg1, "Site, Histology require age at diagnosis to assign %F1: %V1")
                    functions.GEN_SAVE_TEXT(binding, discrim_msg1)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}, Age at Diagnosis: ${untrimmedline.ageAtDiagnosis}, Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} are incompatible with AJCC ID: ${untrimmedline.ajccId}. If coding correct, contact software vendor for assistance. ')
                }
            }
        }
        return true

    }

    // ID: NAACCR-02350; TAG: N5022; NAME: Date Initial RX SEER, Ca Dir RX, Schema ID (SEER)
    public boolean naaccr02350(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int scope_flag
        int dx_year
        int seer_init_year
        
        scope_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        seer_init_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateInitialRxSeer)
        
        if (seer_init_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year >= 2018 && dx_year <= 2020) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && dx_year >= 2021) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98") || functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6")) {
            if (seer_init_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If treatment fields indicate treatment, Date Initial RX SEER must not be blank')
            else
                return true
        }
        char[] ID = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if ((functions.GEN_AT(code, ID, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 589,700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                scope_flag = 1
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0"))
                scope_flag = 1
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1") && dx_year >= 2021) {
                    scope_flag = 1
                }
            }
        }
        if (seer_init_year != ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && scope_flag == 1 && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99") && functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82,85-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If treatment fields indicate no treatment, Date Initial RX SEER must be blank')
            else
                return true
        }
        return true

    }

    // ID: NAACCR-02351; TAG: N5017; NAME: Mets at DX-BBDLLO, Schema ID, Primary Site, 2018 (NAACCR)
    public boolean naaccr02351(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9671"))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "012", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (dx_year >= 2018 && dx_year <= 2021) {
            if (functions.GEN_AT(untrimmedline.schemaId, "00790007950083099999", 5) != 0) {
                if (functions.GEN_AT(untrimmedline.metsAtDxBone, "8") != 0 && functions.GEN_AT(untrimmedline.metsAtDxBrain, "8") != 0 && functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "8") != 0 && functions.GEN_AT(untrimmedline.metsAtDxLiver, "8") != 0 && functions.GEN_AT(untrimmedline.metsAtDxLung, "8") != 0 && functions.GEN_AT(untrimmedline.metsAtDxOther, "8") != 0)
                    return true
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00822", 5) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420-421,423-424", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.metsAtDxBone, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsAtDxBrain, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsAtDxLiver, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsAtDxLung, "8") == 0)
                return false
            if (functions.GEN_AT(untrimmedline.metsAtDxOther, "8") == 0)
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "8") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For Primary Site: ${untrimmedline.primarySite}, Mets at DX-Distant LN must = 8, other Mets at DX must not = 8')
                if (functions.GEN_AT(untrimmedline.metsAtDxBone, "8") != 0 || functions.GEN_AT(untrimmedline.metsAtDxBrain, "8") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "8") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "8") != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "8") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For Primary Site: ${untrimmedline.primarySite}, Mets at DX-Distant LN must = 8, other Mets at DX must not = 8')
            }
            else {
        
                if (functions.GEN_AT(untrimmedline.metsAtDxBone, "8") != 0)
                    return false
                if (functions.GEN_AT(untrimmedline.metsAtDxBrain, "8") != 0)
                    return false
                if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "8") != 0)
                    return false
                if (functions.GEN_AT(untrimmedline.metsAtDxLiver, "8") != 0)
                    return false
                if (functions.GEN_AT(untrimmedline.metsAtDxLung, "8") != 0)
                    return false
                if (functions.GEN_AT(untrimmedline.metsAtDxOther, "8") != 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02352; TAG: N5023; NAME: RX Hosp--Surg Prim Site, Primary Site, 2018 (COC)
    public boolean naaccr02352(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Grpcode)
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site is invalid code')
        }
        if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "41") != 0) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxHospSurgPrimSite)
        
        if (dx_year >= 2018 && dx_year <= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SURG03_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (dx_year >= 2022) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SURG22, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SURG22_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Hosp--Surg Prim Site: ${untrimmedline.rxHospSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        return true

    }

    // ID: NAACCR-02353; TAG: N5020; NAME: Autopsy Only, RX, Schema ID, Primary Site, 2018 (NPCR)
    public boolean naaccr02353(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, err_flag
        err_flag = 0
        char[] code = new char[7]
        char[] nodenine = new char[2]
        char[] ID2 = new char[15]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98", "(\\d\\d)")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Prim Site')
            err_flag = 1
        }
        functions.GEN_STRCPY(nodenine, "0")
        
        
        functions.GEN_STRCPY(ID2, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID2, 6) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 589, 700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3))
            functions.GEN_STRCPY(nodenine, "1")
        else {
            if (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9734") == 0)
                functions.GEN_STRCPY(nodenine, "1")
        }
        if (functions.GEN_AT(nodenine, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "9") == 0) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                err_flag = 1
            }
        }
        else {
            if (functions.GEN_AT(nodenine, "0") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "0") == 0) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                    err_flag = 1
                }
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,9")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Reason for No Surgery')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--BRM')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Chemo')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Hormone')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Other')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Transplnt/Endocr')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Phase I Radiation Treatment Modality')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg/Rad Seq')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Systemic/Sur Seq')
            err_flag = 1
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-02354; TAG: N5019; NAME: RX Summ--Scope Reg LN Sur, Schema ID, Primary Site, 2018 (NAACCR)
    public boolean naaccr02354(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID2 = new char[25]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.primarySite, "C422") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID2, "00790 00795 99999 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID2, 6) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,589,700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9734") == 0)) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "9") != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-02355; TAG: N5015; NAME: RX Summ--Surg Prim Site, Primary Site, 2018 (COC)
    public boolean naaccr02355(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Grpcode)
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site is invalid code')
        }
        if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "41") != 0) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
        if (dx_year >= 2018 && dx_year <= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SURG03_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (dx_year >= 2022) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SURG22, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SURG22_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        return true

    }

    // ID: NAACCR-02356; TAG: N5016; NAME: RX Summ--Surg Prim Site, Primary Site, 2018 (SEER)
    public boolean naaccr02356(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "99") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Grpcode)
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site is invalid code')
        }
        if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "41") != 0) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
        if (dx_year >= 2018 && dx_year <= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SURG03_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (dx_year >= 2022) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SURG22, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SURG22_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        return true

    }

    // ID: NAACCR-02357; TAG: N5018; NAME: RX Summ--Surgical Margins, Surg Prim Site, Primary Site, 2018 (NAACCR)
    public boolean naaccr02357(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalMargins))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "98") != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgicalMargins, "9") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surgical Margins: ${untrimmedline.rxSummSurgicalMargins} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgicalMargins, "9") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Surgical Margins: ${untrimmedline.rxSummSurgicalMargins} and Primary Site: ${untrimmedline.primarySite}')
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) == 8) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surgical Margins: ${untrimmedline.rxSummSurgicalMargins} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) == 0) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) != 8)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surgical Margins: ${untrimmedline.rxSummSurgicalMargins} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        return true

    }

    // ID: NAACCR-02358; TAG: N5000; NAME: Behavior Code ICDO3, Summary Stage 2018, Schema ID (NAACCR)
    public boolean naaccr02358(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) != 0) {
                if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") == 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "08", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02359; TAG: N5021; NAME: Surgery, RX Date Surgery, Schema ID (COC)
    public boolean naaccr02359(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int exception
        int dx_year
        
        exception = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        char[] ID = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if ((functions.GEN_AT(code, ID, 6) != 0 && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9734") == 0) || functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 589, 700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3))
            exception = 1
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && dx_year >= 2021) || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year >= 2019 && dx_year <= 2020) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "12"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If surgery performed and RX Date Surgery is blank, RX Date Surgery Flag must = 12')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || ((exception == 1 && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1") && dx_year >= 2021))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, RX Summ--Scope Reg LN Sur = ${untrimmedline.rxSummScopeRegLnSur}, and RX Summ--Surg Oth Reg/Dis = ${untrimmedline.rxSummSurgOthRegDis}, RX Date Surgery Flag must = 11')
        }
        return true

    }

    // ID: NAACCR-02360; TAG: N4025; NAME: Reason for No Radiation, Rad--Location of RX (COC)
    public boolean naaccr02360(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0", 1) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.radLocationOfRx, "1-9"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "12567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "09", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02361; TAG: N4024; NAME: Reason for No Radiation, RX Date Rad Ended (COC)
    public boolean naaccr02361(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02362; TAG: N4027; NAME: RX Date Rad Ended, Radiation Items (COC)
    public boolean naaccr02362(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberPhasesOfRadTxToVolume) && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume) && functions.GEN_EMPTY(untrimmedline.radiationTxDiscontinuedEarly) && functions.GEN_EMPTY(untrimmedline.totalDose))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.numberPhasesOfRadTxToVolume, "00", 2) != 0 || functions.GEN_AT(untrimmedline.phase1RadiationPrimaryTxVolume, "00", 2) != 0 || functions.GEN_AT(untrimmedline.radiationTxDiscontinuedEarly, "00", 2) != 0 || functions.GEN_AT(untrimmedline.totalDose, "000000", 6) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02363; TAG: N5024; NAME: RX Hosp--Scope Reg LN Sur, Schema ID, Primary Site, 2018 (COC)
    public boolean naaccr02363(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID2 = new char[25]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.primarySite, "C422") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID2, "00790 00795 99999 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID2, 6) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,589,700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9734") == 0)) {
            if (functions.GEN_AT(untrimmedline.rxHospScopeRegLnSur, "9") != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-02364; TAG: N5025; NAME: RX Summ--Treatm Stat, Treatment (NAACCR)
    public boolean naaccr02364(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year <= 2020) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2-7") && dx_year >= 2021) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0"))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0,2")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7,9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8") && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00"))
                        return true
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "9")) {
                        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") || functions.GEN_INLIST(untrimmedline.rxSummOther, "9") || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "99")) {
        
                            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7,9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88,99") && functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8,9") && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99"))
                                return true
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                        }
                        else
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                    }
                }
            }
        }
        
        return true

    }

    // ID: NAACCR-02365; TAG: N5026; NAME: AJCC TNM Post Therapy Path (yp) Stage, RX Dates (COC)
    public boolean naaccr02365(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int true_flag
        true_flag = 0
        int dx_year
        
        functions.GEN_NOOP()
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateSystemic)) {
            return true
        }
        if (!functions.GEN_AT(untrimmedline.tnmEditionNumber, "0809", 2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT) && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") == 0) {
        
            if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
                dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.rxDateMostDefinSurg, ((Integer)context.NAACCR_GEN_DT_MAX))
        
                if (dtcmp != ((Integer)context.NAACCR_GEN_DT_ERROR)) {
                    if (dtcmp < 0)
                        true_flag = 1
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
                dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.rxDateMostDefinSurg, ((Integer)context.NAACCR_GEN_DT_MAX))
        
                if (dtcmp != ((Integer)context.NAACCR_GEN_DT_ERROR)) {
                    if (dtcmp < 0)
                        true_flag = 1
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
                dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.rxDateMostDefinSurg, ((Integer)context.NAACCR_GEN_DT_MAX))
        
                if (dtcmp != ((Integer)context.NAACCR_GEN_DT_ERROR)) {
                    if (dtcmp < 0)
                        true_flag = 1
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
                dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.rxDateMostDefinSurg, ((Integer)context.NAACCR_GEN_DT_MAX))
        
                if (dtcmp != ((Integer)context.NAACCR_GEN_DT_ERROR)) {
                    if (dtcmp < 0)
                        true_flag = 1
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
                dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.rxDateMostDefinSurg, ((Integer)context.NAACCR_GEN_DT_MAX))
        
                if (dtcmp != ((Integer)context.NAACCR_GEN_DT_ERROR)) {
                    if (dtcmp < 0)
                        true_flag = 1
                }
            }
            if (true_flag != 1)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If AJCC TNM Post Therapy Path (yp) T = ${untrimmedline.ajccTnmPostTherapyT}, at least one rx date must be less than RX Date Mst Defn Srg: ${untrimmedline.rxDateMostDefinSurg.formatDate()} ')
        }
        return true

    }

    // ID: NAACCR-02366; TAG: N5027; NAME: Grade Clin, Grade Path (NAACCR)
    public boolean naaccr02366(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int clin, path, dx_year
        
        clin = functions.GEN_VAL(untrimmedline.gradeClinical)
        path = functions.GEN_VAL(untrimmedline.gradePathological)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_AT(untrimmedline.gradePathological, "9") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.gradeClinical, "89", 1) != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-90")) {
            if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
                if (clin >= 1 && path >= 1) {
                    if (path < clin || path == 8)
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-02369; TAG: N3034; NAME: Circumferential Resection Margin (CRM), Colon, Surg Prim Site/Margins (NAACCR)
    public boolean naaccr02369(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200", 5) == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin) || functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "180,182-189", "(C\\d\\d\\d)", 2, 3)) {
        
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-28")) {
                if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.7", 4) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
            }
        }
        if (functions.GEN_AT(untrimmedline.primarySite, "C209") != 0) {
        
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-26,28")) {
                if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.7", 4) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-80")) {
            if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.7", 4) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, " 0.0", 4) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgicalMargins, "0", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Circumferential Resection Margin (CRM): ${untrimmedline.circumferentialResectionMargin} conflicts with RX Summ--Surgical Margins: ${untrimmedline.rxSummSurgicalMargins}')
        }
        return true

    }

    // ID: NAACCR-02370; TAG: N5031; NAME: EOD Regional Nodes, Breast, Reg Nodes Positive, Scope Nodes (SEER)
    public boolean naaccr02370(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "030050070", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0099", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "200250300", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "030050070200250300", 3) != 0 && !functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) {
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "0") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} for Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
            else {
                if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth) {
                    if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "01234567", 1) == 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur}')
                }
                else {
                    if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "1234567", 1) == 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur}')
                }
            }
        }
        return true

    }

    // ID: NAACCR-02371; TAG: N3049; NAME: LN Positive Axillary Level I-II, Breast, EOD Regional Nodes (SEER)
    public boolean naaccr02371(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "01-99,X1,X5,X6")) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02372; TAG: N5032; NAME: ER Summary, Breast, ER Percent (NAACCR)
    public boolean naaccr02372(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary))
            return true
        if (functions.GEN_AT(untrimmedline.estrogenReceptorPercntPosOrRange, "XX8", 3) != 0 || functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercntPosOrRange))
            return true
        if (functions.GEN_INLIST(untrimmedline.estrogenReceptorPercntPosOrRange, "001-100,R10-R99")) {
            if (functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02373; TAG: N5033; NAME: PR Summary, Breast, PR Percent (NAACCR)
    public boolean naaccr02373(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary))
            return true
        if (functions.GEN_AT(untrimmedline.progesteroneRecepPrcntPosOrRange, "XX8") != 0 || functions.GEN_EMPTY(untrimmedline.progesteroneRecepPrcntPosOrRange))
            return true
        if (functions.GEN_INLIST(untrimmedline.progesteroneRecepPrcntPosOrRange, "001-100,R10-R99")) {
            if (functions.GEN_AT(untrimmedline.progesteroneRecepSummary, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02374; TAG: N5034; NAME: HER2 Overall Summary, Breast, IHC, ISH (NAACCR)
    public boolean naaccr02374(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "3") != 0 && functions.GEN_AT(untrimmedline.her2IshSummary, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.her2OverallSummary, "1") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "014", 1) != 0 && functions.GEN_AT(untrimmedline.her2IshSummary, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.her2OverallSummary, "0") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02375; TAG: N5036; NAME: AJCC TNM N Suffix, Date of Sentinel Node Biopsy (COC)
    public boolean naaccr02375(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "47") == 0 || functions.GEN_AT(untrimmedline.ajccId, "48.148.2", 4) == 0)
            return true
        char[] cnsuff = new char[5]
        char[] pnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(cnsuff, " ")
        functions.GEN_STRCAT(cnsuff, untrimmedline.ajccTnmClinNSuffix)
        functions.GEN_STRCPY(pnsuff, " ")
        functions.GEN_STRCAT(pnsuff, untrimmedline.ajccTnmPathNSuffix)
        
        if (functions.GEN_AT(cnsuff, " (sn)") != 0 || functions.GEN_AT(pnsuff, " (sn)") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsy) && functions.GEN_AT(untrimmedline.dateSentinelLymphNodeBiopsyFlag, "12") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02376; TAG: N5039; NAME: Rad--Regional RX Modality, Date of Diagnosis Pre2018 (COC)
    public boolean naaccr02376(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (dx_year > 2002 && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
                return false
        }
        return true

    }

    // ID: NAACCR-02377; TAG: N5040; NAME: Rad--Regional Dose: cGy, Date of Diagnosis Pre2018 (COC)
    public boolean naaccr02377(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (dx_year > 2002 && functions.GEN_EMPTY(untrimmedline.phase1RadiationPrimaryTxVolume)) {
            if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
                return false
        }
        return true

    }

    // ID: NAACCR-02378; TAG: N3960; NAME: Tumor Deposits, Colorectal, EOD Regional Nodes (SEER)
    public boolean naaccr02378(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.tumorDeposits, "00X9", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "200") != 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99,X1,X2")) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "200300800") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02379; TAG: N5041; NAME: Brain Molecular Markers, Summary Stage 2018 (NAACCR)
    public boolean naaccr02379(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) || functions.GEN_AT(untrimmedline.brainMolecularMarkers, "88") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "86", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "8", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "8699", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02380; TAG: N5042; NAME: Breslow Tumor Thickness, Melanoma, Summary Stage 2018 (NAACCR)
    public boolean naaccr02380(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.breslowTumorThickness) || functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02381; TAG: N5043; NAME: Tumor Deposits, Colorectal, Summary Stage 2018 (NAACCR)
    public boolean naaccr02381(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99", "(\\d\\d)") || functions.GEN_AT(untrimmedline.tumorDeposits, "X1X2", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02382; TAG: N5055; NAME: LN Positive Axillary Level I-II, Breast, Summary Stage 2018 (NAACCR)
    public boolean naaccr02382(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "01-99", "(\\d\\d)") || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X1X5X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02383; TAG: N6064; NAME: AJCC TNM Clin/Path T (COC)
    public boolean naaccr02383(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "XX") || functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0809", 2) == 0)
            return true
        if (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathT, 1, 2), "88") != 0 || functions.GEN_EMPTY(untrimmedline.ajccTnmPathT))
            return true
        if (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathT, 1, 3), "pT0") != 0) {
            if (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinT, 1, 3), "cT0cTX", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.ajccTnmClinT))
                return false
        }
        return true

    }

    // ID: NAACCR-02384; TAG: N6065; NAME: RX Summ--Treatm Stat, Treatment, Blanks (NAACCR)
    public boolean naaccr02384(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "1")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year <= 2020) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2-7") && dx_year >= 2021) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-12,20,30,40") || functions.GEN_INLIST(untrimmedline.rxSummOther, "1,2,3,6") || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0"))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0,2")) {
                    if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7,9") || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) && (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) && (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) && (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummChemo)) && (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummHormone)) && (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88") || functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) && (functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8") || functions.GEN_EMPTY(untrimmedline.rxSummOther)) && (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00") || functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality)))
                        return true
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "9")) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) && functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) && functions.GEN_EMPTY(untrimmedline.rxSummBrm) && functions.GEN_EMPTY(untrimmedline.rxSummChemo) && functions.GEN_EMPTY(untrimmedline.rxSummHormone) && functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr) && functions.GEN_EMPTY(untrimmedline.rxSummOther) && functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") || functions.GEN_INLIST(untrimmedline.rxSummOther, "9") || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "99")) {
        
                    if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98,99") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7,9") || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) && (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) && (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummBrm)) && (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummChemo)) && (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummHormone)) && (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,80-88,99") || functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) && (functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8,9") || functions.GEN_EMPTY(untrimmedline.rxSummOther)) && (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99") || functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality)))
                        return true
                    else
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
                }
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Treatment Status and treatment codes')
            }
        }
        
        return true

    }

    // ID: NAACCR-02387; TAG: N4210; NAME: Date Regional Lymph Node Dissection, RX Date Surgery (NAACCR)
    public boolean naaccr02387(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLNDissection) || functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        if (dx_year < 2019)
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateRegionalLNDissection, untrimmedline.rxDateSurgery, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-02388; TAG: N2836; NAME: Sentinel Lymph Nodes Ex, Reg Nodes Ex, Date RLN Dissection (COC)
    public boolean naaccr02388(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int sen, reg
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0047000480", 5) == 0)
            return true
        sen = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        reg = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (sen != 0 && (sen != 95 && sen != 98 && sen != 99)) {
            if (sen == reg) {
                if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLNDissection))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02389; TAG: N4030; NAME: Date of Sentinel Lymph Node Biopsy, RX Summ Scope Reg LN Sur (COC)
    public boolean naaccr02389(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0047000480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.dateSentinelLymphNodeBiopsy)) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "267", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02390; TAG: N4207; NAME: Sentinel Lymph Nodes Ex, Reg Nodes Ex, Date RLN Dissection, CoC Flag (SEER)
    public boolean naaccr02390(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int sen, reg
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0047000480", 5) == 0)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        sen = functions.GEN_VAL(untrimmedline.sentinelLymphNodesExamined)
        reg = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        if (functions.GEN_EMPTY(untrimmedline.sentinelLymphNodesExamined))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (sen != 0 && (sen != 95 && sen != 98 && sen != 99)) {
            if (sen == reg) {
        
                if (!functions.GEN_EMPTY(untrimmedline.dateRegionalLNDissection) || (!functions.GEN_EMPTY(untrimmedline.dateRegionalLNDissectionFlag) && functions.GEN_AT(untrimmedline.dateRegionalLNDissectionFlag, "1011", 2) == 0))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If Sentinel Lymph Nodes Examined = Regional Nodes Examined, Date Regional Lymph Node Dissection must be blank and Date Regional Lymph Node Dissection Flag indicate reason why')
            }
        }
        return true

    }

    // ID: NAACCR-02391; TAG: N6071; NAME: Date of Diagnosis, Required (NAACCR)
    public boolean naaccr02391(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int dx_contact
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_contact = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (dx_contact == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_contact == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_contact < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Date of Diagnosis must not be blank for cases diagnosed 2019 and later')
        if (!functions.GEN_EMPTY(untrimmedline.dateOfDiagnosisFlag))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Date of Diagnosis Flag must be blank for cases diagnosed 2019 and later')
        return true

    }

    // ID: NAACCR-02392; TAG: N6066; NAME: HER2 IHC Summary, Schema ID, Required, CoC Flag (SEER)
    public boolean naaccr02392(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IhcSummary) || functions.GEN_AT(untrimmedline.her2IhcSummary, "8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02393; TAG: N6067; NAME: HER2 ISH Summary, Schema ID, Required, CoC Flag (SEER)
    public boolean naaccr02393(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshSummary) || functions.GEN_AT(untrimmedline.her2IshSummary, "8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02394; TAG: N6068; NAME: HER2 ISH Dual Probe Ratio, Schema ID, Required, CoC Flag (SEER)
    public boolean naaccr02394(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeRatio) || functions.GEN_AT(untrimmedline.her2IshDualProbeRatio, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02395; TAG: N6069; NAME: HER2 ISH Dual Probe Copy Number, Schema ID, Required, CoC Flag (SEER)
    public boolean naaccr02395(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshDualProbeCopyNumber) || functions.GEN_AT(untrimmedline.her2IshDualProbeCopyNumber, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02396; TAG: N6070; NAME: HER2 ISH Single Probe Copy Number, Schema ID, Required, CoC Flag (SEER)
    public boolean naaccr02396(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.her2IshSingleProbeCopyNumber) || functions.GEN_AT(untrimmedline.her2IshSingleProbeCopyNumber, "XX.8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02397; TAG: N5045; NAME: Extranodal Extension Head and Neck Path, EOD Regional Nodes (SEER)
    public boolean naaccr02397(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckPath, "X.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 3, 1))
        
        if (functions.GEN_AT(ENE, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200250300400450800", 3) == 0)
                return false
        }
        if (functions.GEN_INLIST(ENE, "01-99, X1-X4")) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "150500600700", 3) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02398; TAG: N5044; NAME: Extranodal Extension Head and Neck Path, Summary Stage 2018 (NAACCR)
    public boolean naaccr02398(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckPath, "X.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 3, 1))
        
        if (functions.GEN_INLIST(ENE, "00-99", "(\\d\\d)") || functions.GEN_AT(ENE, "X1X2X3X4", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02399; TAG: N5046; NAME: Extranodal Extension Clin/Path, Merkel Cell, Summary Stage 2018 (NAACCR)
    public boolean naaccr02399(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02400; TAG: N5047; NAME: Extranodal Extension Clin/Path, Penis, Summary Stage 2018 (NAACCR)
    public boolean naaccr02400(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02401; TAG: N2880; NAME: FIGO Stage, Gynecologic, Schema ID (NAACCR)
    public boolean naaccr02401(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], FIGO = new char[6]
        
        int dx_year
        
        char[] ID = new char[90]
        char[] code = new char[6]
        char[] group_FIGO = new char[15]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.figoStage)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 00528 00530 00541 00542 00551 00552 00553 00560 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.figoStage)) {
            functions.GEN_STRCPY(group_FIGO, untrimmedline.schemaId)
            functions.GEN_STRCAT(group_FIGO, functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)))
        
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_FIGOSTAGE, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_FIGOSTAGE_SCHEMA_IDFIGO, functions.GEN_TRIM(group_FIGO, ((Integer)context.NAACCR_GEN_RIGHT)), ['SCHEMA_ID':SCHEMA_ID, 'FIGO':FIGO]))
                return false
        }
        return true

    }

    // ID: NAACCR-02402; TAG: N5048; NAME: FIGO Stage, Summary Stage 2018 (NAACCR)
    public boolean naaccr02402(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[80]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 00528 00530 00551 00552 00553 00560 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.figoStage) || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)), "98") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)), "97") != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") != 0 && functions.GEN_AT(untrimmedline.schemaId, "005300055100553", 5) == 0) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)), "97") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02403; TAG: N6093; NAME: Grade Post Therapy, Gleason Patterns Pathological (NAACCR)
    public boolean naaccr02403(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        
        if (functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapy, "9", 1) == 0) {
            if (functions.GEN_AT(GPP, "X9", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02404; TAG: N3951; NAME: Gleason Patterns Clinical, Grade Clinical (NAACCR)
    public boolean naaccr02404(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(GPC, "111213212223313233", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "1") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "34", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "2") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "43", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "3") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "443553", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "4") == 0)
                return false
        }
        if (functions.GEN_AT(GPC, "455455", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "5") == 0)
                return false
        }
        
        return true

    }

    // ID: NAACCR-02405; TAG: N3038; NAME: Gleason Patterns/Score Clinical, Clin Proc (NAACCR)
    public boolean naaccr02405(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        char[] GSC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0) && (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if ((functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19,99", "(\\d\\d)")) && functions.GEN_AT(untrimmedline.rxSummDxStgProc, "00030409", 2) != 0 && (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) || functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "0349", 1) != 0)) {
            if ((functions.GEN_AT(GPC, "X7X9", 2) == 0 && functions.GEN_AT(GPC, "X8", 2) == 0 && !functions.GEN_EMPTY(GPC)) || (functions.GEN_AT(GSC, "X7X9", 2) == 0 && functions.GEN_AT(GSC, "X8", 2) == 0 && !functions.GEN_EMPTY(GSC)))
                return false
        }
        return true

    }

    // ID: NAACCR-02406; TAG: N3037; NAME: Gleason Patterns/Score, Clin/Path (NAACCR)
    public boolean naaccr02406(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        char[] GSC = new char[3]
        char[] GPP = new char[3]
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0) && (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0) && (functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0) && (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0))
            return true
        if (!functions.GEN_EMPTY(GSC) && functions.GEN_AT(GSC, "X8") == 0) {
            if (functions.GEN_AT(GPC, "11", 2) != 0) {
                if (functions.GEN_AT(GSC, "02", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "1221", 2) != 0) {
                if (functions.GEN_AT(GSC, "03", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "132231", 2) != 0) {
                if (functions.GEN_AT(GSC, "04", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "14233241", 2) != 0) {
                if (functions.GEN_AT(GSC, "05", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "1524334251", 2) != 0) {
                if (functions.GEN_AT(GSC, "06", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "25344352", 2) != 0) {
                if (functions.GEN_AT(GSC, "07", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "354453", 2) != 0) {
                if (functions.GEN_AT(GSC, "08", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "4554", 2) != 0) {
                if (functions.GEN_AT(GSC, "09", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "55", 2) != 0) {
                if (functions.GEN_AT(GSC, "10", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "X7", 2) != 0) {
                if (functions.GEN_AT(GSC, "X7", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
        }
        if (!functions.GEN_EMPTY(GSP) && functions.GEN_AT(GSP, "X8") == 0) {
            if (functions.GEN_AT(GPP, "11", 2) != 0) {
                if (functions.GEN_AT(GSP, "02", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "1221", 2) != 0) {
                if (functions.GEN_AT(GSP, "03", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "132231", 2) != 0) {
                if (functions.GEN_AT(GSP, "04", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "14233241", 2) != 0) {
                if (functions.GEN_AT(GSP, "05", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "1524334251", 2) != 0) {
                if (functions.GEN_AT(GSP, "06", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "25344352", 2) != 0) {
                if (functions.GEN_AT(GSP, "07", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "354453", 2) != 0) {
                if (functions.GEN_AT(GSP, "08", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "4554", 2) != 0) {
                if (functions.GEN_AT(GSP, "09", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "55", 2) != 0) {
                if (functions.GEN_AT(GSP, "10", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "X7", 2) != 0) {
                if (functions.GEN_AT(GSP, "X7", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
        }
        return true

    }

    // ID: NAACCR-02407; TAG: N4214; NAME: Gleason Score Clinical, Grade Clinical (NAACCR)
    public boolean naaccr02407(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GSC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        
        if (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0 || functions.GEN_AT(GSC, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(GSC, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "1") == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "23E", 1) == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "4") == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "0910", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "5") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02409; TAG: N3092; NAME: High Risk Histologic Features, Skin, Grade (NAACCR)
    public boolean naaccr02409(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00150", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.highRiskHistologicFeatures))
            return true
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "0135689", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "3") == 0 && functions.GEN_AT(untrimmedline.gradeClinical, "3") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.highRiskHistologicFeatures, "4") != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "4") == 0 && functions.GEN_AT(untrimmedline.gradeClinical, "4") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02410; TAG: N5050; NAME: Invasion Beyond Capsule, Kidney, Summary Stage 2018 (NAACCR)
    public boolean naaccr02410(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "1345", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Invasion Beyond Capsule: ${untrimmedline.invasionBeyondCapsule} conflicts with Summary Stage 2018: ${untrimmedline.summaryStage2018}')
        }
        return true

    }

    // ID: NAACCR-02411; TAG: N3053; NAME: Invasion Beyond Capsule, Kidney, EOD Primary Tumor (SEER)
    public boolean naaccr02411(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "1345", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "200300400500600700999", 3) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02412; TAG: N5051; NAME: Ipsilateral Adrenal Gland Involvement, Kidney, Summary Stage 2018 (NAACCR)
    public boolean naaccr02412(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolve) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02413; TAG: N3954; NAME: Ipsilateral Adrenal Gland Involvement, Kidney, EOD Tumor, Mets (SEER)
    public boolean naaccr02413(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolve) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "600700999", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ipsilateral Adrenal Gland Involvement: ${untrimmedline.ipsilateralAdrenalGlandInvolve} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "70", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Ipsilateral Adrenal Gland Involvement: ${untrimmedline.ipsilateralAdrenalGlandInvolve} conflicts with EOD Mets: ${untrimmedline.eodMets}')
        }
        return true

    }

    // ID: NAACCR-02415; TAG: N3041; NAME: LN Distant Assessment Method, Surgery Other Site (NAACCR)
    public boolean naaccr02415(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.classOfCase, "38") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantAssessMethod) || functions.GEN_AT(untrimmedline.lnDistantAssessMethod, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantAssessMethod, "2", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "35", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02416; TAG: N3042; NAME: LN Distant, Gynecologic, EOD Mets, CoC Flag (SEER)
    public boolean naaccr02416(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "1070", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02417; TAG: N5052; NAME: LN Distant, Gynecologic, Summary Stage 2018 (NAACCR)
    public boolean naaccr02417(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02418; TAG: N3046; NAME: LN Head and Neck Levels, EOD Regional Nodes (SEER)
    public boolean naaccr02418(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "0006000140", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther) || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "1234567", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000800999", 3) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "9", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "9", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "9", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "9", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "800999", 3) == 0)
                return false
        }
        if (dx_year >= 2021) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000800999", 3) == 0) {
                if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "0", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "0", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "0", 1) != 0 && functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "0", 1) != 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02419; TAG: N5053; NAME: LN Head and Neck Levels, Melanoma Head/Neck, Summary Stage 2018 (NAACCR)
    public boolean naaccr02419(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00140") == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels1To3) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels4To5) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckLevels6To7) || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.lnHeadAndNeckOther) || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels1To3, "1234567", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels4To5, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckLevels6To7, "123", 1) != 0 || functions.GEN_AT(untrimmedline.lnHeadAndNeckOther, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02420; TAG: N3047; NAME: LN Isolated Tumor Cells (ITC), Merkel Cell, EOD Regional Nodes (SEER)
    public boolean naaccr02420(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) || functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000600700999", 3) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02421; TAG: N5054; NAME: LN Isolated Tumor Cells (ITC), Merkel Cell, Summary Stage 2018 (NAACCR)
    public boolean naaccr02421(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) || functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02422; TAG: N3048; NAME: LN Laterality, Vulva, EOD Regional Nodes (SEER)
    public boolean naaccr02422(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00500", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnLaterality) || functions.GEN_AT(untrimmedline.lnLaterality, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnLaterality, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Laterality: ${untrimmedline.lnLaterality} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

    // ID: NAACCR-02423; TAG: N5056; NAME: LN Laterality, Vulva, Summary Stage 2018 (NAACCR)
    public boolean naaccr02423(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00500", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnLaterality) || functions.GEN_AT(untrimmedline.lnLaterality, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnLaterality, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02424; TAG: N3050; NAME: LN Size, Head/Neck, EOD Regional Nodes (SEER)
    public boolean naaccr02424(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00130 00131 00132 00133 00140 00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnSize) || functions.GEN_AT(untrimmedline.lnSize, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.lnSize, " 0.0XX.9", 4) == 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000999", 3) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02425; TAG: N5057; NAME: LN Size, Head/Neck, Summary Stage 2018 (NAACCR)
    public boolean naaccr02425(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00130 00131 00132 00133 00140 00150 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnSize) || functions.GEN_AT(untrimmedline.lnSize, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnSize, " 0.0XX.9", 4) == 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02427; TAG: N5058; NAME: LN Status Femoral-Inguinal, Para-Aortic, Pelvic, Gynecologic, Summary Stage 2018 (NAACCR)
    public boolean naaccr02427(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[35]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019 || dx_year > 2021) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 09520 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnStatusFemorInguinParaaortPelv) || functions.GEN_AT(untrimmedline.lnStatusFemorInguinParaaortPelv, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnStatusFemorInguinParaaortPelv, "1234567", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02428; TAG: N3985; NAME: Lymphovascular Invasion, Penis, EOD Primary Tumor (SEER)
    public boolean naaccr02428(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "200400450500550600700999", 3) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02429; TAG: N5059; NAME: Lymphovascular Invasion, Penis, Summary Stage 2018 (NAACCR)
    public boolean naaccr02429(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02430; TAG: N3986; NAME: Lymphovascular Invasion, Testis, EOD Primary Tumor (SEER)
    public boolean naaccr02430(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "300400500600700999", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "300") != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "100150200", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "09", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02431; TAG: N5060; NAME: Lymphovascular Invasion, Testis, Summary Stage 2018 (NAACCR)
    public boolean naaccr02431(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02432; TAG: N6061; NAME: Major Vein Involvement, Kidney, Summary Stage 2018 (NAACCR)
    public boolean naaccr02432(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02433; TAG: N3052; NAME: Major Vein Involvement, Kidney, EOD Primary Tumor (SEER)
    public boolean naaccr02433(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "134", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "200300400500600700999", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "2", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "300400500600700999", 3) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02434; TAG: N3064; NAME: Number of Cores Examined, Prostate, DX/Stg Proc (NAACCR)
    public boolean naaccr02434(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined) || functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.numberOfCoresExamined, "01-99,X1,X6")) {
            if (functions.GEN_AT(untrimmedline.rxSummDxStgProc, "020506", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X7") != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummDxStgProc, "02") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02435; TAG: N3065; NAME: Number of Positive/Examined Para-Aortic Nodes, Corpus (NAACCR)
    public boolean naaccr02435(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        char[] ID = new char[28]
        char[] code = new char[6]
        
        ex = functions.GEN_VAL(untrimmedline.numberOfExaminedParaAorticNodes)
        pos = functions.GEN_VAL(untrimmedline.numberOfPositiveParaAorticNodes)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true /*list of schema IDs for SSDI with added blank for clarity in edit display*/
        functions.GEN_STRCPY(ID, "00528 00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X6X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X9", 2) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedParaAorticNodes, "01-99")) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1X6", 2) != 0)
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X1X2", 2) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.numberOfPositiveParaAorticNodes, "00-99,X1,X2,X9"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X1X2", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02436; TAG: N3066; NAME: Number of Positive/Examined Pelvic Nodes, Corpus (NAACCR)
    public boolean naaccr02436(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        char[] ID = new char[28]
        char[] code = new char[6]
        
        ex = functions.GEN_VAL(untrimmedline.numberOfExaminedPelvicNodes)
        pos = functions.GEN_VAL(untrimmedline.numberOfPositivePelvicNodes)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true /*list of schema IDs for SSDI with added blank for clarity in edit display*/
        functions.GEN_STRCPY(ID, "00528 00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X6X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X9", 2) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedPelvicNodes, "01-99")) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1X6", 2) != 0)
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X1X2", 2) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.numberOfPositivePelvicNodes, "00-99,X1,X2,X9"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X1X2", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02437; TAG: N3958; NAME: Separate Tumor Nodules, Lung, EOD Primary Tumor (SEER)
    public boolean naaccr02437(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules) || functions.GEN_AT(untrimmedline.separateTumorNodules, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "14", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "500600650675700999", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "700", 3) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02438; TAG: N6062; NAME: Separate Tumor Nodules, Lung, Summary Stage 2018 (NAACCR)
    public boolean naaccr02438(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.separateTumorNodules) || functions.GEN_AT(untrimmedline.separateTumorNodules, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "14", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.separateTumorNodules, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02439; TAG: N3031; NAME: Testis Serum Markers Post-Orchiectomy, Range (NAACCR)
    public boolean naaccr02439(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.ldhPostOrchiectomyRange) || functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.sCategoryPathological) || functions.GEN_AT(untrimmedline.sCategoryPathological, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "001220", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.afpPostOrchiectomyRange, "9") == 0 || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyRange, "9") == 0 || functions.GEN_AT(untrimmedline.ldhPostOrchiectomyRange, "9") == 0 || functions.GEN_AT(untrimmedline.sCategoryPathological, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Testis Serum Markers must be coded "no orchiectomy performed" if no orchiectomy performed')
        }
        return true

    }

    // ID: NAACCR-02440; TAG: N3062; NAME: Visceral and Parietal Pleural Invasion, Lung, EOD Primary Tumor (SEER)
    public boolean naaccr02440(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.visceralParietalPleuralInvasion) || functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "46", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "450500600650675700999", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Visceral and Parietal Pleural Invasion: ${untrimmedline.visceralParietalPleuralInvasion} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        if (functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "5", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "500600650675700999", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Visceral and Parietal Pleural Invasion: ${untrimmedline.visceralParietalPleuralInvasion} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        return true

    }

    // ID: NAACCR-02441; TAG: N6063; NAME: Visceral and Parietal Pleural Invasion, Lung, Summary Stage 2018 (NAACCR)
    public boolean naaccr02441(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00360") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.visceralParietalPleuralInvasion) || functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "456", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02442; TAG: N6073; NAME: Peritoneal Cytology, Gynecologic, Summary Stage 2018 (NAACCR)
    public boolean naaccr02442(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00528005300054100542", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.peritonealCytology) || functions.GEN_AT(untrimmedline.peritonealCytology, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.peritonealCytology, "2", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "013", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02443; TAG: N6074; NAME: Pleural Effusion, Pleura, Summary Stage 2018 (NAACCR)
    public boolean naaccr02443(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00370", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.pleuralEffusion) || functions.GEN_AT(untrimmedline.pleuralEffusion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.pleuralEffusion, "2", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02444; TAG: N6075; NAME: EOD Regional Nodes, Thyroid, Reg Nodes Positive, Scope Nodes (SEER)
    public boolean naaccr02444(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0073000740", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "050", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "9899", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00", "(\\d\\d)") && !functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
            if (!functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) {
        
                if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6") != 0) {
                    if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "0") == 0)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} for Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
                }
                else {
                    if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth) {
                        if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "01234567", 1) == 0)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur}')
                    }
                    else {
                        if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "1234567", 1) == 0)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} conflicts with RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur}')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-02445; TAG: N6076; NAME: EOD Mets, Type of Reporting Source (SEER)
    public boolean naaccr02445(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_AT(untrimmedline.eodMets, "99") != 0) {
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02446; TAG: N6077; NAME: SSDIs, Benign Brain and CNS (NAACCR)
    public boolean naaccr02446(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossHeterozygosity)) {
            if (functions.GEN_AT(untrimmedline.chromosome1pLossHeterozygosity, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 1p: Loss of Heterozygosity (LOH): ${untrimmedline.chromosome1pLossHeterozygosity} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossHeterozygosity)) {
            if (functions.GEN_AT(untrimmedline.chromosome19qLossHeterozygosity, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 19q: Loss of Heterozygosity (LOH): ${untrimmedline.chromosome19qLossHeterozygosity} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} ')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MGMT)) {
            if (functions.GEN_AT(untrimmedline.methylationOfO6MGMT, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Methylation of O6-Methylguanine-Methyltransferase: ${untrimmedline.methylationOfO6MGMT} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
            }
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.chromosome1pLossHeterozygosity)) {
                if (functions.GEN_AT(untrimmedline.chromosome1pLossHeterozygosity, "68", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 1p: Loss of Heterozygosity (LOH): ${untrimmedline.chromosome1pLossHeterozygosity} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
            }
            if (!functions.GEN_EMPTY(untrimmedline.chromosome19qLossHeterozygosity)) {
                if (functions.GEN_AT(untrimmedline.chromosome19qLossHeterozygosity, "68", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Chromosome 19q: Loss of Heterozygosity (LOH): ${untrimmedline.chromosome19qLossHeterozygosity} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} ')
            }
            if (!functions.GEN_EMPTY(untrimmedline.methylationOfO6MGMT)) {
                if (functions.GEN_AT(untrimmedline.methylationOfO6MGMT, "68", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Methylation of O6-Methylguanine-Methyltransferase: ${untrimmedline.methylationOfO6MGMT} conflicts with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
            }
        }
        return true

    }

    // ID: NAACCR-02447; TAG: N4213; NAME: Gleason Patterns Pathological, Grade Pathological (NAACCR)
    public boolean naaccr02447(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GPP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        
        clin = functions.GEN_VAL(untrimmedline.gradeClinical)
        path = functions.GEN_VAL(untrimmedline.gradePathological)
        
        if ((functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (clin >= path && clin != 9)
            return true
        if (functions.GEN_AT(untrimmedline.gradeClinical, "E") != 0 && functions.GEN_AT(untrimmedline.gradePathological, "123E", 1) != 0)
            return true
        if (functions.GEN_AT(GPP, "111213212223313233", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "01") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "34", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "2") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "43", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "3") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "443553", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "4") == 0)
                return false
        }
        if (functions.GEN_AT(GPP, "455455", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "5") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02448; TAG: N3952; NAME: Gleason Score Pathological, Grade Pathological (NAACCR)
    public boolean naaccr02448(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        clin = functions.GEN_VAL(untrimmedline.gradeClinical)
        path = functions.GEN_VAL(untrimmedline.gradePathological)
        
        if (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0 || functions.GEN_AT(GSP, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (clin >= path && clin != 9)
            return true
        if (functions.GEN_AT(untrimmedline.gradeClinical, "E") != 0 && functions.GEN_AT(untrimmedline.gradePathological, "123E", 1) != 0)
            return true
        if (functions.GEN_AT(GSP, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "1") == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "23E", 1) == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "4") == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "0910", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "5") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02449; TAG: N6078; NAME: Gleason Patterns Pathological, EOD Prostate Pathologic Extension (SEER)
    public boolean naaccr02449(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GPP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gleasonPatternsPathological))
            return true
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        
        if (functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
            return true
        if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "900", 3) != 0) {
            if (functions.GEN_AT(GPP, "X7", 2) == 0)
                return false
        }
        if (dx_year >= 2019 && dx_year <= 2021) {
        
            if (functions.GEN_AT(GPP, "X7", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "900950", 3) == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "950", 3) != 0) {
                if (functions.GEN_AT(GPP, "X7X9", 2) == 0)
                    return false
            }
        }
        if (dx_year >= 2022) {
        
            if (functions.GEN_AT(GPP, "X7", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "900", 3) == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "950", 3) != 0) {
                if (functions.GEN_AT(GPP, "X9", 2) == 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02450; TAG: N6079; NAME: EOD Regional Nodes, Regional Nodes Positive (SEER)
    public boolean naaccr02450(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00811") != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) != 0) {
                if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) == 0)
                    return false
            }
        }
        else {
        
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000030050070", 3) != 0) {
                if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) == 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02451; TAG: N6081; NAME: Invasion Beyond Capsule, Kidney, Surgery (SEER)
    public boolean naaccr02451(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.invasionBeyondCapsule) || functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27")) {
            if (functions.GEN_AT(untrimmedline.invasionBeyondCapsule, "9", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02452; TAG: N6082; NAME: Ipsilateral Adrenal Gland Involvement, Kidney, Surgery (SEER)
    public boolean naaccr02452(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ipsilateralAdrenalGlandInvolve) || functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27") && functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "03", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.ipsilateralAdrenalGlandInvolve, "9", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02453; TAG: N6083; NAME: Major Vein Involvement, Kidney, Surgery (SEER)
    public boolean naaccr02453(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00600") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.majorVeinInvolvement) || functions.GEN_AT(untrimmedline.majorVeinInvolvement, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27")) {
            if (functions.GEN_AT(untrimmedline.majorVeinInvolvement, "9", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02454; TAG: N6084; NAME: Tumor Deposits, Colorectal, Surgery (SEER)
    public boolean naaccr02454(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0 && fivemonth)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00200") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-29")) {
            if (functions.GEN_AT(untrimmedline.tumorDeposits, "X9", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02455; TAG: N6085; NAME: Percent Necrosis Post Neoadjuvant, Bone, DX Confirm (NAACCR)
    public boolean naaccr02455(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00381 00382 00383 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) || functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.diagnosticConfirmation))
            return true
        if (functions.GEN_AT(untrimmedline.diagnosticConfirmation, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant: ${untrimmedline.percentNecrosisPostNeoadjuvant} conflicts with Diagnostic Confirmation: ${untrimmedline.diagnosticConfirmation}')
        }
        return true

    }

    // ID: NAACCR-02456; TAG: N6086; NAME: Date Regional Lymph Node Dissection, RX Date Surgery, CoC Flag (SEER)
    public boolean naaccr02456(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.dateRegionalLNDissection) || functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        if (dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateRegionalLNDissection, untrimmedline.rxDateSurgery, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-02457; TAG: N6087; NAME: LN Distant, Gynecologic, Mets at DX-Distant LN (NAACCR)
    public boolean naaccr02457(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02458; TAG: N6088; NAME: LN Isolated Tumor Cells (ITC), Merkel Cell, Reg Nodes Positive (NAACCR)
    public boolean naaccr02458(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnIsolatedTumorCells) || functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "98") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Isolated Tumor Cells (ITC): ${untrimmedline.lnIsolatedTumorCells} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        if (functions.GEN_AT(untrimmedline.lnIsolatedTumorCells, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Isolated Tumor Cells (ITC): ${untrimmedline.lnIsolatedTumorCells} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        return true
        
        return true

    }

    // ID: NAACCR-02459; TAG: N6089; NAME: LN Positive Axillary Level I-II, Breast, Reg Nodes Positive (NAACCR)
    public boolean naaccr02459(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnPositiveAxillaryLevel1To2) || functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "X8") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.lnPositiveAxillaryLevel1To2, "01-99,X1,X5,X6")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) != 0 || functions.GEN_AT(untrimmedline.regionalNodesExamined, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} and Regional Nodes Examined: ${untrimmedline.regionalNodesExamined}')
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "95") != 0) {
            if (functions.GEN_AT(untrimmedline.lnPositiveAxillaryLevel1To2, "00X6X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LN Positive Axillary Level I-II: ${untrimmedline.lnPositiveAxillaryLevel1To2} conflicts with Regional Nodes Positive: ${untrimmedline.regionalNodesPositive}')
        }
        return true

    }

    // ID: NAACCR-02460; TAG: N6104; NAME: Summary Stage 2018, Regional Nodes Positive (NAACCR)
    public boolean naaccr02460(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97", "(\\d\\d)")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02461; TAG: N6092; NAME: FIGO Stage, Gynecologic, EOD Primary Tumor (SEER)
    public boolean naaccr02461(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[80]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 00528 00530 00551 00552 00553 00560 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.figoStage) || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)), "98") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)), "97") != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000") != 0) {
            if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.figoStage, ((Integer)context.NAACCR_GEN_RIGHT)), "97") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02462; TAG: N6091; NAME: Extranodal Extension Head and Neck Clin/Path, Summary Stage 2018 (NAACCR)
    public boolean naaccr02462(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckClin) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckPath, "X.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 3, 1))
        
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "7", 1) != 0 && functions.GEN_AT(ENE, "X7", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "0124", 1) != 0 && functions.GEN_INLIST(ENE, "00-99, X1-X4")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02463; TAG: N6105; NAME: Grade Post Therapy, Gleason Score Pathological, Tertiary Pattern (NAACCR)
    public boolean naaccr02463(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) || functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8") != 0))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapy, "9", 1) == 0 && !functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
            if ((functions.GEN_AT(GSP, "X9", 2) == 0 && functions.GEN_AT(GSP, "X8", 2) == 0 && !functions.GEN_EMPTY(GSP)) || (functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X9", 2) == 0 && functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)))
                return false
        }
        return true

    }

    // ID: NAACCR-02464; TAG: N6094; NAME: Grade Post Therapy, Gleason Score Pathological, Tertiary Pattern, CoC Flag (SEER)
    public boolean naaccr02464(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern) || functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapy, "9", 1) == 0 && !functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
            if ((functions.GEN_AT(GSP, "X9", 2) == 0 && functions.GEN_AT(GSP, "X8", 2) == 0 && !functions.GEN_EMPTY(GSP)) || (functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X9", 2) == 0 && functions.GEN_AT(untrimmedline.gleasonTertiaryPattern, "X8", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.gleasonTertiaryPattern)))
                return false
        }
        return true

    }

    // ID: NAACCR-02465; TAG: N6096; NAME: Gleason Score Clinical, Grade Clinical, CoC Flag (SEER)
    public boolean naaccr02465(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GSC = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        
        if (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0 || functions.GEN_AT(GSC, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(GSC, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "1") == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "23E", 1) == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "4") == 0)
                return false
        }
        if (functions.GEN_AT(GSC, "0910", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "5") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02466; TAG: N6097; NAME: Gleason Score Pathological, Grade Pathological, CoC Flag (SEER)
    public boolean naaccr02466(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, clin, path
        
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        clin = functions.GEN_VAL(untrimmedline.gradeClinical)
        path = functions.GEN_VAL(untrimmedline.gradePathological)
        
        if (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0 || functions.GEN_AT(GSP, "X9") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (clin >= path && clin != 9)
            return true
        if (functions.GEN_AT(untrimmedline.gradeClinical, "E") != 0 && functions.GEN_AT(untrimmedline.gradePathological, "123E", 1) != 0)
            return true
        if (functions.GEN_AT(GSP, "010203040506", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "1") == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "23E", 1) == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "4") == 0)
                return false
        }
        if (functions.GEN_AT(GSP, "0910", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "5") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02467; TAG: N6106; NAME: Gleason Patterns/Score, Clin/Path, CoC Flag (SEER)
    public boolean naaccr02467(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] GPC = new char[3]
        char[] GSC = new char[3]
        char[] GPP = new char[3]
        char[] GSP = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        functions.GEN_STRCPY(GPC, untrimmedline.gleasonPatternsClinical)
        functions.GEN_STRCPY(GSC, untrimmedline.gleasonScoreClinical)
        functions.GEN_STRCPY(GPP, untrimmedline.gleasonPatternsPathological)
        functions.GEN_STRCPY(GSP, untrimmedline.gleasonScorePathological)
        
        if ((functions.GEN_EMPTY(GPC) || functions.GEN_AT(GPC, "X8") != 0) && (functions.GEN_EMPTY(GSC) || functions.GEN_AT(GSC, "X8") != 0) && (functions.GEN_EMPTY(GPP) || functions.GEN_AT(GPP, "X8") != 0) && (functions.GEN_EMPTY(GSP) || functions.GEN_AT(GSP, "X8") != 0))
            return true
        if (!functions.GEN_EMPTY(GSC) && functions.GEN_AT(GSC, "X8") == 0) {
            if (functions.GEN_AT(GPC, "11", 2) != 0) {
                if (functions.GEN_AT(GSC, "02", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "1221", 2) != 0) {
                if (functions.GEN_AT(GSC, "03", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "132231", 2) != 0) {
                if (functions.GEN_AT(GSC, "04", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "14233241", 2) != 0) {
                if (functions.GEN_AT(GSC, "05", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "1524334251", 2) != 0) {
                if (functions.GEN_AT(GSC, "06", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "25344352", 2) != 0) {
                if (functions.GEN_AT(GSC, "07", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "354453", 2) != 0) {
                if (functions.GEN_AT(GSC, "08", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "4554", 2) != 0) {
                if (functions.GEN_AT(GSC, "09", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "55", 2) != 0) {
                if (functions.GEN_AT(GSC, "10", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
            if (functions.GEN_AT(GPC, "X7", 2) != 0) {
                if (functions.GEN_AT(GSC, "X7", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Clinical: ${untrimmedline.gleasonPatternsClinical} is not valid for Gleason Score Clinical: ${untrimmedline.gleasonScoreClinical}')
            }
        }
        if (!functions.GEN_EMPTY(GSP) && functions.GEN_AT(GSP, "X8") == 0) {
            if (functions.GEN_AT(GPP, "11", 2) != 0) {
                if (functions.GEN_AT(GSP, "02", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "1221", 2) != 0) {
                if (functions.GEN_AT(GSP, "03", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "132231", 2) != 0) {
                if (functions.GEN_AT(GSP, "04", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "14233241", 2) != 0) {
                if (functions.GEN_AT(GSP, "05", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "1524334251", 2) != 0) {
                if (functions.GEN_AT(GSP, "06", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "25344352", 2) != 0) {
                if (functions.GEN_AT(GSP, "07", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "354453", 2) != 0) {
                if (functions.GEN_AT(GSP, "08", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "4554", 2) != 0) {
                if (functions.GEN_AT(GSP, "09", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "55", 2) != 0) {
                if (functions.GEN_AT(GSP, "10", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
            if (functions.GEN_AT(GPP, "X7", 2) != 0) {
                if (functions.GEN_AT(GSP, "X7", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Gleason Patterns Pathological: ${untrimmedline.gleasonPatternsPathological} is not valid for Gleason Score Pathological ${untrimmedline.gleasonScorePathological}')
            }
        }
        return true

    }

    // ID: NAACCR-02469; TAG: N6099; NAME: LN Distant Assessment Method, Surgery Other Site, CoC Flag (SEER)
    public boolean naaccr02469(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantAssessMethod) || functions.GEN_AT(untrimmedline.lnDistantAssessMethod, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantAssessMethod, "2", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "35", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02470; TAG: N6100; NAME: LN Distant, Gynecologic, Mets at DX-Distant LN, CoC Flag (SEER)
    public boolean naaccr02470(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02471; TAG: N6101; NAME: Number of Positive/Examined Para-Aortic Nodes, Corpus, CoC Flag (SEER)
    public boolean naaccr02471(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        char[] ID = new char[28]
        char[] code = new char[6]
        
        ex = functions.GEN_VAL(untrimmedline.numberOfExaminedParaAorticNodes)
        pos = functions.GEN_VAL(untrimmedline.numberOfPositiveParaAorticNodes)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00528 00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X6X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X9", 2) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedParaAorticNodes, "01-99")) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1X6", 2) != 0)
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X1X2", 2) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.numberOfPositiveParaAorticNodes, "00-99,X1,X2,X9"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X1") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X1X2", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02472; TAG: N6102; NAME: Number of Positive/Examined Pelvic Nodes, Corpus, CoC Flag (SEER)
    public boolean naaccr02472(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        char[] ID = new char[28]
        char[] code = new char[6]
        
        ex = functions.GEN_VAL(untrimmedline.numberOfExaminedPelvicNodes)
        pos = functions.GEN_VAL(untrimmedline.numberOfPositivePelvicNodes)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00528 00530 00541 00542 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X6", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X6X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X9", 2) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedPelvicNodes, "01-99")) {
            if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1X6", 2) != 0)
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X1X2", 2) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.numberOfPositivePelvicNodes, "00-99,X1,X2,X9"))
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X1") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X1X2", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02473; TAG: N6103; NAME: Percent Necrosis Post Neoadjuvant, Bone, DX Confirm, CoC Flag (SEER)
    public boolean naaccr02473(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00381 00382 00383 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.percentNecrosisPostNeoadjuvant) || functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.diagnosticConfirmation))
            return true
        if (functions.GEN_AT(untrimmedline.diagnosticConfirmation, "1") == 0) {
            if (functions.GEN_AT(untrimmedline.percentNecrosisPostNeoadjuvant, "XXX.9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Percent Necrosis Post Neoadjuvant: ${untrimmedline.percentNecrosisPostNeoadjuvant} conflicts with Diagnostic Confirmation: ${untrimmedline.diagnosticConfirmation}')
        }
        return true

    }

    // ID: NAACCR-02474; TAG: N6107; NAME: Extranodal Extension Head and Neck Path, Head/Neck, Reg Nodes Positive (NAACCR)
    public boolean naaccr02474(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 3, 1))
        
        if (functions.GEN_INLIST(ENE, "00-99, X1-X4")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0098", 2) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0) {
            if (functions.GEN_AT(ENE, "X7X9", 2) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "98") != 0) {
            if (functions.GEN_AT(ENE, "X9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02475; TAG: N6108; NAME: Extranodal Extension Path (non-Head and Neck), Reg Nodes Positive (NAACCR)
    public boolean naaccr02475(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00460 00570 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        functions.GEN_STRCPY(ENE, untrimmedline.extranodalExtensionPath)
        
        if (functions.GEN_AT(ENE, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0098", 2) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0) {
            if (functions.GEN_AT(ENE, "79", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "98") != 0) {
            if (functions.GEN_AT(ENE, "9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02476; TAG: N6109; NAME: Extranodal Extension Path (non-Head and Neck), Reg Nodes Positive, CoC Flag (SEER)
    public boolean naaccr02476(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00460 00570 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        functions.GEN_STRCPY(ENE, untrimmedline.extranodalExtensionPath)
        
        if (functions.GEN_AT(ENE, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "0098", 2) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0) {
            if (functions.GEN_AT(ENE, "79", 1) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "98") != 0) {
            if (functions.GEN_AT(ENE, "9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02477; TAG: N6110; NAME: Number of Examined Para-Aortic/Pelvic Nodes, Corpus, Reg Nodes Examined (NAACCR)
    public boolean naaccr02477(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00528005300054100542", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "00") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with Number of Examined Para-Aortic Nodes: ${untrimmedline.numberOfExaminedParaAorticNodes} and Number of Examined Pelvic Nodes: ${untrimmedline.numberOfExaminedPelvicNodes}')
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "95") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00X6X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00X6X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with Number of Examined Para-Aortic Nodes: ${untrimmedline.numberOfExaminedParaAorticNodes} and Number of Examined Pelvic Nodes: ${untrimmedline.numberOfExaminedPelvicNodes}')
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedParaAorticNodes, "01-99,X1,X2,X6") || functions.GEN_INLIST(untrimmedline.numberOfExaminedPelvicNodes, "01-99,X1,X2,X6")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with Number of Examined Para-Aortic Nodes: ${untrimmedline.numberOfExaminedParaAorticNodes} and Number of Examined Pelvic Nodes: ${untrimmedline.numberOfExaminedPelvicNodes}')
        }
        return true

    }

    // ID: NAACCR-02478; TAG: N6111; NAME: Number of Positive Para-Aortic/Pelvic Nodes, Corpus, Reg Nodes Positive (NAACCR)
    public boolean naaccr02478(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00528005300054100542", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0))
            return true
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} and Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes}')
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "95") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X6X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X6X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} and Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes}')
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfPositiveParaAorticNodes, "01-99,X1,X2,X6") || functions.GEN_INLIST(untrimmedline.numberOfPositivePelvicNodes, "01-99,X1,X2,X6")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} and Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes}')
        }
        return true

    }

    // ID: NAACCR-02479; TAG: N6112; NAME: Number of Examined Para-Aortic/Pelvic Nodes, Corpus, Reg Nodes Examined, CoC Flag (SEER)
    public boolean naaccr02479(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00528005300054100542", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfExaminedParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfExaminedPelvicNodes) || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "00") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with Number of Examined Para-Aortic Nodes: ${untrimmedline.numberOfExaminedParaAorticNodes} and Number of Examined Pelvic Nodes: ${untrimmedline.numberOfExaminedPelvicNodes}')
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "95") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfExaminedParaAorticNodes, "00X6X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfExaminedPelvicNodes, "00X6X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with Number of Examined Para-Aortic Nodes: ${untrimmedline.numberOfExaminedParaAorticNodes} and Number of Examined Pelvic Nodes: ${untrimmedline.numberOfExaminedPelvicNodes}')
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfExaminedParaAorticNodes, "01-99,X1,X2,X6") || functions.GEN_INLIST(untrimmedline.numberOfExaminedPelvicNodes, "01-99,X1,X2,X6")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesExamined, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Examined: ${untrimmedline.regionalNodesExamined} conflicts with Number of Examined Para-Aortic Nodes: ${untrimmedline.numberOfExaminedParaAorticNodes} and Number of Examined Pelvic Nodes: ${untrimmedline.numberOfExaminedPelvicNodes}')
        }
        return true

    }

    // ID: NAACCR-02480; TAG: N6113; NAME: Number of Positive Para-Aortic/Pelvic Nodes, Corpus, Reg Nodes Positive, CoC Flag (SEER)
    public boolean naaccr02480(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00528005300054100542", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0))
            return true
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} and Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes}')
        }
        if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "95") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X6X9", 2) == 0 || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X6X9", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} and Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes}')
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfPositiveParaAorticNodes, "01-99,X1,X2,X6") || functions.GEN_INLIST(untrimmedline.numberOfPositivePelvicNodes, "01-99,X1,X2,X6")) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Regional Nodes Positive: ${untrimmedline.regionalNodesPositive} conflicts with Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} and Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes}')
        }
        return true

    }

    // ID: NAACCR-02481; TAG: N6114; NAME: Number of Cores Positive/Examined, Prostate (NAACCR)
    public boolean naaccr02481(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos
        int dx_year
        
        ex = functions.GEN_VAL(untrimmedline.numberOfCoresExamined)
        pos = functions.GEN_VAL(untrimmedline.numberOfCoresPositive)
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfCoresPositive) || functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfCoresExamined) || functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X8") != 0))
            return true
        if (functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X7") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X7") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X7") != 0) {
            if (functions.GEN_AT(untrimmedline.numberOfCoresPositive, "X7") == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.numberOfCoresExamined, "01-99")) {
            if (!functions.GEN_INLIST(untrimmedline.numberOfCoresPositive, "00-99,X6,X9"))
                return false
        }
        if (ex >= 1 && ex <= 99) {
            if (pos > ex)
                return false
        }
        if (functions.GEN_AT(untrimmedline.numberOfCoresExamined, "X1X6", 2) != 0) {
            if (!functions.GEN_INLIST(untrimmedline.numberOfCoresPositive, "00-99,X1,X6,X9"))
                return false
        }
        return true

    }

    // ID: NAACCR-02482; TAG: N6116; NAME: Extranodal Extension Head and Neck Clin/Path, Summary Stage 2018, CoC Flag (SEER)
    public boolean naaccr02482(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckClin) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckPath, "X.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 3, 1))
        
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "7", 1) != 0 && functions.GEN_AT(ENE, "X7", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "0124", 1) != 0 && functions.GEN_INLIST(ENE, "00-99, X1-X4")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02483; TAG: N6117; NAME: Extranodal Extension Clin/Path, Merkel Cell, Summary Stage 2018, CoC Flag (SEER)
    public boolean naaccr02483(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02484; TAG: N6118; NAME: Extranodal Extension Clin/Path, Penis, Summary Stage 2018, CoC Flag (SEER)
    public boolean naaccr02484(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "34", 1) != 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02485; TAG: N6119; NAME: LN Distant, Gynecologic, Summary Stage 2018, CoC Flag (SEER)
    public boolean naaccr02485(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00510 00520 09520 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnDistantMediastinalScalene) || functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lnDistantMediastinalScalene, "123", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "7", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02486; TAG: N6120; NAME: ER Summary, Breast, ER Percent, CoC Flag (SEER)
    public boolean naaccr02486(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary))
            return true
        if (functions.GEN_AT(untrimmedline.estrogenReceptorPercntPosOrRange, "XX8", 3) != 0 || functions.GEN_EMPTY(untrimmedline.estrogenReceptorPercntPosOrRange))
            return true
        if (functions.GEN_INLIST(untrimmedline.estrogenReceptorPercntPosOrRange, "001-100,R10-R99")) {
            if (functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02487; TAG: N6121; NAME: PR Summary, Breast, PR Percent, CoC Flag (SEER)
    public boolean naaccr02487(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary))
            return true
        if (functions.GEN_AT(untrimmedline.progesteroneRecepPrcntPosOrRange, "XX8") != 0 || functions.GEN_EMPTY(untrimmedline.progesteroneRecepPrcntPosOrRange))
            return true
        if (functions.GEN_INLIST(untrimmedline.progesteroneRecepPrcntPosOrRange, "001-100,R10-R99")) {
            if (functions.GEN_AT(untrimmedline.progesteroneRecepSummary, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02488; TAG: N6122; NAME: HER2 Overall Summary, Breast, IHC, ISH, CoC Flag (SEER)
    public boolean naaccr02488(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019 || dx_year > 2020)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "3") != 0 && functions.GEN_AT(untrimmedline.her2IshSummary, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.her2OverallSummary, "1") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.her2IhcSummary, "014", 1) != 0 && functions.GEN_AT(untrimmedline.her2IshSummary, "0") != 0) {
            if (functions.GEN_AT(untrimmedline.her2OverallSummary, "0") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02489; TAG: N3090; NAME: Extranodal Extension Head and Neck Clin/Path, EOD Regional Nodes, CoC Flag (SEER)
    public boolean naaccr02489(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[140]
        char[] code = new char[6]
        char[] ENE = new char[3]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00060 00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 ")
        functions.GEN_STRCAT(ID, "00112 00121 00122 00131 00132 00133 00130 00140 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckClin) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "8") != 0) || (functions.GEN_EMPTY(untrimmedline.extranodalExtensionHeadNeckPath) || functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckPath, "X.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        functions.GEN_STRCPY(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 1, 1))
        functions.GEN_STRCAT(ENE, functions.GEN_SUBSTR(untrimmedline.extranodalExtensionHeadNeckPath, 3, 1))
        
        if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "7", 1) != 0 && functions.GEN_AT(ENE, "X7", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0)
                return false
        }
        if (functions.GEN_AT(code, "00090 00100 00140 ", 6) == 0) {
            if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "07", 1) != 0 && functions.GEN_AT(ENE, "00", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200250300400800", 3) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(code, "00090 00100 00140 ", 6) == 0) {
            if (functions.GEN_AT(untrimmedline.extranodalExtensionHeadNeckClin, "124", 1) != 0 && functions.GEN_AT(ENE, "X7") != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "450", 3) == 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02490; TAG: N6123; NAME: Testis Serum Markers Post-Orchiectomy, Lab Value (NAACCR)
    public boolean naaccr02490(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.8") != 0) && (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "001220", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.9") == 0 || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Testis Serum Markers must be coded "no orchiectomy performed" if no orchiectomy performed')
        }
        return true

    }

    // ID: NAACCR-02491; TAG: N6124; NAME: Testis Serum Markers Post-Orchiectomy, Lab Value, CoC Flag (SEER)
    public boolean naaccr02491(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.afpPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.8") != 0) && (functions.GEN_EMPTY(untrimmedline.hcgPostOrchiectomyLabValue) || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "001220", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.afpPostOrchiectomyLabValue, "XXXXX.9") == 0 || functions.GEN_AT(untrimmedline.hcgPostOrchiectomyLabValue, "XXXXX.9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Testis Serum Markers must be coded "no orchiectomy performed" if no orchiectomy performed')
        }
        return true

    }

    // ID: NAACCR-02492; TAG: N6125; NAME: Oncotype Dx Recurrence Score-DCIS, Breast, Behavior, CoC Flag (SEER)
    public boolean naaccr02492(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRecurrenceScoreDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX6", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.oncotypeDxRecurrenceScoreDcis, "XX6", 3) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02493; TAG: N6126; NAME: Oncotype Dx Risk Level-DCIS, Breast, Behavior, CoC Flag (SEER)
    public boolean naaccr02493(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelDcis) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "6") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelDcis, "6") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02494; TAG: N6127; NAME: Oncotype Dx Risk Level-Invasive, Breast, Behavior, CoC Flag (SEER)
    public boolean naaccr02494(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        functions.GEN_NOOP()
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.oncotypeDxRiskLevelInvasive) || functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "6") == 0)
                return false
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorCodeIcdO3, "3") == 0) {
        
            if (functions.GEN_AT(untrimmedline.oncotypeDxRiskLevelInvasive, "6") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02495; TAG: N3043; NAME: Extranodal Extension Clin/Path, Merkel Cell, EOD Regional Nodes, CoC Flag (SEER)
    public boolean naaccr02495(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00460", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000600700", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200650800", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "300350500750", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "400750", 3) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Extranodal Extension Clin (non-Head and Neck): ${untrimmedline.extranodalExtensionClin} and Extranodal Extension Path (non-Head and Neck): ${untrimmedline.extranodalExtensionPath} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

    // ID: NAACCR-02496; TAG: N3035; NAME: Extranodal Extension Clin/Path, Penis, EOD Regional Nodes, CoC Flag (SEER)
    public boolean naaccr02496(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00570", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.extranodalExtensionClin) || functions.GEN_AT(untrimmedline.extranodalExtensionClin, "8") != 0) && (functions.GEN_EMPTY(untrimmedline.extranodalExtensionPath) || functions.GEN_AT(untrimmedline.extranodalExtensionPath, "8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "7", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionClin, "0124", 1) != 0 && functions.GEN_AT(untrimmedline.extranodalExtensionPath, "7", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200300800", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionPath, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "400500", 3) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.extranodalExtensionPath, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "500", 3) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02497; TAG: N6128; NAME: EOD Prostate Pathologic Extension, Blank for Other Schemas (SEER)
    public boolean naaccr02497(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00580") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
                return false
        }
        return true

    }

    // ID: NAACCR-02499; TAG: N6129; NAME: Tumor Size 998, Schema ID (SEER)
    public boolean naaccr02499(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[100]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00161 00169 00170 00200 00290 00330 00360 00370 00400 00410 00421 00430 00450 00470 00480 00459 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0) {
            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "998") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is not valid for Schema ID: ${untrimmedline.schemaId}')
            if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "998") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} is not valid for Schema ID: ${untrimmedline.schemaId}')
            if (functions.GEN_AT(untrimmedline.tumorSizePathologic, "998") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} is not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: NAACCR-02500; TAG: N6130; NAME: Tumor Size 999, Schema ID, Primary Site (SEER)
    public boolean naaccr02500(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[90]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_AT(untrimmedline.primarySite, "C422")) {
            return true
        }
        functions.GEN_STRCPY(ID, "00458 00671 00672 00790 00795 00821 00822 00830 ") /* add blank to coded Schema ID to match edit string*/
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "999") == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is not valid for Schema ID: ${untrimmedline.schemaId}')
            if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "999") == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeClinical))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} is not valid for Schema ID: ${untrimmedline.schemaId}')
            if (functions.GEN_AT(untrimmedline.tumorSizePathologic, "999") == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} is not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: NAACCR-02502; TAG: N3058; NAME: Residual Tumor Volume Post Cytoreduction, Gynecologic, Surg Prim Site, Seq (NAACCR)
    public boolean naaccr02502(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(functions.GEN_LEFT(untrimmedline.schemaId, 4), "0055", 4) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.residualTumVolPostCytoreduction) || functions.GEN_AT(untrimmedline.residualTumVolPostCytoreduction, "98") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-57") && functions.GEN_AT(untrimmedline.schemaId, "00551") != 0) {
            if (functions.GEN_AT(untrimmedline.residualTumVolPostCytoreduction, "97", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Residual Tumor Volume Post Cytoreduction: ${untrimmedline.residualTumVolPostCytoreduction} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-41") && functions.GEN_AT(untrimmedline.schemaId, "0055200553", 5) != 0) {
            if (functions.GEN_AT(untrimmedline.residualTumVolPostCytoreduction, "97", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Residual Tumor Volume Post Cytoreduction: ${untrimmedline.residualTumVolPostCytoreduction} conflicts with RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}')
        }
        return true

    }

    // ID: NAACCR-02504; TAG: N2613; NAME: RX Summ--Surg Prim Site, Lymphoma (COC)
    public boolean naaccr02504(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2019)
            return true
        if (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccId, 1, 2), "79") == 0)
            return true
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup) || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.NAACCR_GEN_RIGHT)), "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.NAACCR_GEN_RIGHT)), "99") == 0) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "606162", 2) != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-02505; TAG: N6131; NAME: Schema ID, Site, Histo, Schema Discriminator 1 (NPCR)
    public boolean naaccr02505(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[6], GPNAME = new char[31], SCDSCR1 = new char[2]
        
        int dx_year
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        char[] t_schema_msg = new char[100]
        
        char[] group = new char[5]
        
        char[] flag = new char[2]
        functions.GEN_STRCPY(flag, "00")
        functions.GEN_STRCPY(group, "00000")
        
        char[] Site_Hist_SD = new char[30]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite)) {
            return true
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00430007300074000821", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                return true
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_DISCRIM1SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_DISCRIM1SEER_SITELOW, Site, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1])) {
        
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, untrimmedline.histologicTypeIcdO3)
            }
            else {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site not valid')
                return true
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_DISCRIM1SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_DISCRIM1SEER_SITELOWSITEHIGHHISTLOW, Site_Hist_SD, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0) {
                functions.GEN_STRCPY(Site_Hist_SD, SITELOW)
                functions.GEN_STRCAT(Site_Hist_SD, SITEHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, HISTLOW)
                functions.GEN_STRCAT(Site_Hist_SD, HISTHIGH)
                functions.GEN_STRCAT(Site_Hist_SD, untrimmedline.schemaDiscriminator1)
            }
            else {
                if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for combination of Primary Site: ${untrimmedline.primarySite} and Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
                return true
            }
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 not required and must be blank for combination of Primary Site: ${untrimmedline.primarySite} and Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
            return true
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_DISCRIM1SEER, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_DISCRIM1SEER_SITELOWSITEHIGHHISTLOWHISTHIGHSCDSCR1, Site_Hist_SD, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SCDSCR1':SCDSCR1])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.schemaDiscriminator1, SCDSCR1) == 0)
                functions.GEN_STRCPY(group, GPCODE)
            else
                functions.GEN_STRCPY(flag, "99")
        }
        else
            functions.GEN_STRCPY(flag, "99")
        if (functions.GEN_AT(flag, "99") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_TEXT(binding, 'Combination of site and histology requires Schema Discriminator 1 for correct Schema ID')
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_TEXT(binding, 'Reported value of Schema Discriminator 1 is incorrect for combination of site and histology')
        }
        if (functions.GEN_AT(flag, "00") != 0 && functions.GEN_AT(group, "00000") == 0) {
        
            if (functions.GEN_AT(group, "0010000111", 5) != 0) {
                if (functions.GEN_AT(untrimmedline.schemaId, "0010000111", 5) != 0)
                    return true
            }
            if (functions.GEN_AT(group, "0016100169", 5) != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8020") != 0) {
                if (functions.GEN_AT(untrimmedline.schemaId, "0016100169", 5) != 0)
                    return true
            }
            if (functions.GEN_STRCMP(untrimmedline.schemaId, group) != 0) {
                functions.GEN_STRCPY(t_schema_msg, "Schema Discriminator 1 is incorrect for Reported Schema ID: ")
                functions.GEN_STRCAT(t_schema_msg, untrimmedline.schemaId)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            }
        }
        return true

    }

    // ID: NAACCR-02506; TAG: N6384; NAME: RX Summ--Other, RX Date Other (COC)
    public boolean naaccr02506(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummOther, "0789") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateOther))
                return false
        }
        return true

    }

    // ID: NAACCR-02507; TAG: N6379; NAME: Reason for No Radiation, RX Date Radiation (COC)
    public boolean naaccr02507(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02508; TAG: N6422; NAME: Gleason Patterns Clinical, Schema ID, Required (NPCR)
    public boolean naaccr02508(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580", 5) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.gleasonPatternsClinical) || functions.GEN_AT(untrimmedline.gleasonPatternsClinical, "X8") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02512; TAG: N6132; NAME: EOD Primary Tumor, Primary Site NOS (SEER)
    public boolean naaccr02512(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] NOS = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "140-148,210-221,300-301,380-388", "(C\\d\\d\\d)", 2, 4) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,480-488,760-768", "(C\\d\\d\\d)", 2, 4))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "0079000795", 5) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        functions.GEN_STRCPY(NOS, functions.GEN_SUBSTR(untrimmedline.primarySite, 4, 1))
        
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") != 0) {
            if (functions.GEN_AT(NOS, "9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02513; TAG: N6134; NAME: Tumor Size, EOD Regional Nodes, Mets (SEER)
    public boolean naaccr02513(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[110]
        char[] code = new char[6]
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes) && functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical) && functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) && functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(code, "00458 00671 00672 00790 00795 00821 00822 00830 ", 6) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000") != 0 && functions.GEN_AT(untrimmedline.tumorSizePathologic, "000") != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000") != 0 && functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are inconsistent with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} and EOD Mets: ${untrimmedline.eodMets}')
        }
        if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000") != 0 && functions.GEN_AT(untrimmedline.eodMets, "00") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is inconsistent with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes} and EOD Mets: ${untrimmedline.eodMets}')
        }
        return true

    }

    // ID: NAACCR-02514; TAG: N6135; NAME: Tumor Size, EOD Primary Tumor, Schema ID (SEER)
    public boolean naaccr02514(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[120]
        char[] code = new char[6]
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeClinical) && functions.GEN_EMPTY(untrimmedline.tumorSizePathologic) && functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(code, "00458 00671 00672 00721 00790 00795 00821 00822 00830 ", 6) != 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00111 00112 00118 00119 ")
        functions.GEN_STRCAT(ID, "00121 00122 00128 00131 00132 00133 00140 00150 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0) {
        
            if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000") != 0 && functions.GEN_AT(untrimmedline.tumorSizePathologic, "000") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are not valid for EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor} (known primary H&N)')
            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is not valid for EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor} (known primary H&N)')
        }
        else {
            if (functions.GEN_AT(code, "00060 ") != 0) {
                if ((functions.GEN_AT(untrimmedline.tumorSizeClinical, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeClinical)) && (functions.GEN_AT(untrimmedline.tumorSizePathologic, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizePathologic)))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and/or Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} not valid for Schema ID: ${untrimmedline.schemaId} (unknown primary H&N)')
                if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} not valid for Schema ID: ${untrimmedline.schemaId}')
            }
            else {
                if (functions.GEN_AT(code, "00360 ") != 0) {
                    if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000") != 0) {
                        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800980", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                    }
                    if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0) {
                        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800980", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                    }
                    if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800980", 3) != 0) {
                        if ((functions.GEN_AT(untrimmedline.tumorSizeClinical, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeClinical)) && (functions.GEN_AT(untrimmedline.tumorSizePathologic, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizePathologic)))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                        if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                    }
                }
                else {
                    if (functions.GEN_AT(code, "00580 ") != 0) {
                        if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000") != 0) {
                            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") == 0 && !functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                        }
                        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") != 0) {
                            if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeClinical))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                        }
                        if (functions.GEN_AT(untrimmedline.tumorSizePathologic, "000") != 0) {
                            if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "800") == 0 && !functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} inconsistent with EOD Prostate Pathologic Extension: ${untrimmedline.prostatePathologicalExtension}')
                        }
                        if (functions.GEN_AT(untrimmedline.prostatePathologicalExtension, "800") != 0) {
                            if (functions.GEN_AT(untrimmedline.tumorSizePathologic, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} inconsistent with EOD Prostate Pathologic Extension: ${untrimmedline.prostatePathologicalExtension}')
                        }
                        if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000") != 0 && functions.GEN_AT(untrimmedline.tumorSizePathologic, "000") != 0) {
                            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are inconsistent with Tumor Size Summary: ${untrimmedline.tumorSizeSummary}')
                        }
                        if ((functions.GEN_AT(untrimmedline.tumorSizeClinical, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeClinical)) && (functions.GEN_AT(untrimmedline.tumorSizePathologic, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizePathologic))) {
                            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000999", 3) != 0)
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are inconsistent with Tumor Size Summary: ${untrimmedline.tumorSizeSummary}')
                        }
                    }
                    else {
                        if (functions.GEN_AT(untrimmedline.tumorSizeClinical, "000") != 0 && functions.GEN_AT(untrimmedline.tumorSizePathologic, "000") != 0) {
                            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") == 0 && !functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                        }
                        if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0) {
                            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") == 0 && !functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                        }
                        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") != 0) {
                            if ((functions.GEN_AT(untrimmedline.tumorSizeClinical, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeClinical)) && (functions.GEN_AT(untrimmedline.tumorSizePathologic, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizePathologic)))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Clinical: ${untrimmedline.tumorSizeClinical} and Tumor Size Pathologic: ${untrimmedline.tumorSizePathologic} are inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000999", 3) == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is inconsistent with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-02515; TAG: N6137; NAME: Tumor Size, AJCC TNM T, AJCC ID (COC)
    public boolean naaccr02515(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId) || functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "XX") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        if (functions.GEN_INLIST(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "7,11.1,11.2,12.1,12.2,13.1,13.2,13.3,14,15")) {
            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary: ${untrimmedline.tumorSizeSummary} is not valid for AJCC ID: ${untrimmedline.ajccId}')
        }
        if (!functions.GEN_INLIST(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "7,11.1,11.2,12.1,12.2,13.1,13.2,13.3,14,15")) {
            if ((functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinT, 1, 3), "cT0") != 0 && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathT, 1, 3), "cT0pT0", 3) != 0) || (functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathT, 1, 3), "cT0pT0", 3) != 0) || (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinT, 1, 3), "cT0", 3) != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathT))) {
                if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Tumor Size Summary must not = ${untrimmedline.tumorSizeSummary} if AJCC TNM Clin T or AJCC TNM Path T not = T0')
            }
        }
        if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0) {
            if ((!functions.GEN_EMPTY(untrimmedline.ajccTnmClinT) && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinT, 1, 2), "88") == 0) && (!functions.GEN_EMPTY(untrimmedline.ajccTnmPathT) && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathT, 1, 2), "88") == 0)) {
                if (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinT, 1, 3), "cT0") != 0 || functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathT, 1, 3), "cT0pT0", 3) != 0)
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'AJCC TNM T must be assessed as T0 if Tumor Size Summary = 000')
            }
        }
        return true

    }

    // ID: NAACCR-02516; TAG: N6138; NAME: Tumor Size, AJCC TNM N, AJCC TNM M (COC)
    public boolean naaccr02516(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NAACCR_GEN_RIGHT)), "XX") != 0 || functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmClinN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") && functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccTnmClinM, ((Integer)context.NAACCR_GEN_RIGHT)), "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "000") != 0) {
            if ((functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinN, 1, 3), "cN0") != 0 && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathN, 1, 3), "cN0pN0", 3) != 0 && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinM, 1, 3), "cM0") != 0 && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathM, 1, 3), "cM0") != 0) || (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinN, 1, 3), "cN0") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathN) && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmClinM, 1, 3), "cM0") != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmPathM)) || (functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathN, 1, 3), "cN0pN0", 3) != 0 && functions.GEN_EMPTY(untrimmedline.ajccTnmClinN) && functions.GEN_EMPTY(untrimmedline.ajccTnmClinM) && functions.GEN_AT(functions.GEN_SUBSTR(untrimmedline.ajccTnmPathM, 1, 3), "cM0") != 0))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If Tumor Size Summary = ${untrimmedline.tumorSizeSummary}, assessed values for AJCC TNM N and AJCC TNM M must not indicate no tumor involvement')
        }
        return true

    }

    // ID: NAACCR-02517; TAG: N6140; NAME: Behavior Code ICDO3, EOD Tumor/Nodes/Mets, Schema ID (SEER)
    public boolean naaccr02517(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31]
        
        int dx_year
        char[] ID1 = new char[60]
        char[] ID2 = new char[600]
        char[] ID3 = new char[40]
        char[] ID4 = new char[15]
        char[] ID5 = new char[110]
        char[] ID6 = new char[25]
        char[] ID7 = new char[15]
        char[] ID8 = new char[15]
        char[] ID9 = new char[10]
        char[] ID10 = new char[40]
        
        char[] code = new char[7]
        char[] name = new char[50]
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor) && functions.GEN_EMPTY(untrimmedline.eodRegionalNodes) && functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.NAACCR_GEN_RIGHT)))
        
        
        functions.GEN_STRCPY(ID1, "00190 00570 00610 00620 00631 00633 00750 ")
        
        
        functions.GEN_STRCPY(ID2, "00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 00112 00118 00119 ")
        functions.GEN_STRCAT(ID2, "00121 00122 00128 00130 00131 00132 00133 00140 00150 00161 00169 00170 00180 00200 ")
        functions.GEN_STRCAT(ID2, "00210 00220 00230 00241 00242 00250 00260 00270 00278 00280 00288 00290 00301 00302 ")
        functions.GEN_STRCAT(ID2, "00310 00320 00330 00340 00350 00358 00360 00378 00430 00460 00470 00478  ")
        functions.GEN_STRCAT(ID2, "00558 00559 00560 00590 00598 00600 00638 00640 00650 ")
        functions.GEN_STRCAT(ID2, "00660 00671 00672 00690 00698 00700 00718 00760 00778 00770 ")
        
        
        functions.GEN_STRCPY(ID3, "00500 00510 00520 00552 09520 ")
        
        
        functions.GEN_STRCPY(ID4, "00730 00740 ")
        
        
        functions.GEN_STRCPY(ID5, "00370 00381 00382 00383 00400 00410 00421 00422 00440 00450 00459 00680 00710 00811 00812 ")
        
        
        functions.GEN_STRCPY(ID6, "00541 00542 00528 ")
        
        
        functions.GEN_STRCPY(ID7, "00458 00822 ")
        
        
        functions.GEN_STRCPY(ID8, "00721 00722 ")
        
        
        functions.GEN_STRCPY(ID9, "00060 ")
        
        
        functions.GEN_STRCPY(ID10, "00790 00795 00821 00830 99999 ")
        
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(code, "00480 ") != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050070", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000030050070", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "0005", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, "00553 ", 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050070080", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, "00551 00530 ", 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "00723") != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor} and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID1, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID2, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID3, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID4, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) != 0 && functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050070", 3) != 0 && functions.GEN_AT(untrimmedline.eodMets, "00", 2) != 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID5, 6) != 0 || functions.GEN_AT(code, ID6, 6) != 0 || functions.GEN_AT(code, ID7, 6) != 0 || functions.GEN_AT(code, ID8, 6) != 0 || functions.GEN_AT(code, ID9, 6) != 0 || functions.GEN_AT(code, ID10, 6) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} is invalid for Schema ID: ${untrimmedline.schemaId}')
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
            if (functions.GEN_AT(code, "00480 ") != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000030050070", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "0005", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, "00553 ", 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050070080", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, "00530 00551 ", 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(untrimmedline.schemaId, "00723") != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor} and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID1, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID2, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID3, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID4, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) == 0 || functions.GEN_AT(untrimmedline.eodRegionalNodes, "000050070", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
            if (functions.GEN_AT(code, ID8, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "050", 3) == 0 || functions.GEN_AT(untrimmedline.eodMets, "00", 2) == 0)
                    return true
                else {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}, EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}, and EOD Mets: ${untrimmedline.eodMets}')
                }
            }
        }
        return true

    }

    // ID: NAACCR-02518; TAG: N6145; NAME: Behavior Code ICDO3, Derived SS 2018, Schema ID (SEER)
    public boolean naaccr02518(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID1 = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018)) {
            return true
        }
        functions.GEN_STRCPY(ID1, "00721 00722 00723 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
            if (functions.GEN_AT(code, ID1, 6) != 0) {
                if (functions.GEN_AT(untrimmedline.derivedSummaryStage2018, "8") == 0)
                    return false
            }
        }
        if (functions.GEN_AT(code, ID1, 6) != 0) {
            if (functions.GEN_AT(untrimmedline.derivedSummaryStage2018, "8") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.derivedSummaryStage2018, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.derivedSummaryStage2018, "08", 1) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02519; TAG: N6148; NAME: Mets at DX-Distant LN, EOD Mets, Schema ID (SEER)
    public boolean naaccr02519(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[570]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 00112 00118 00119 ")
        functions.GEN_STRCAT(ID, "00121 00122 00128 00130 00131 00132 00133 00140 00150 00161 00169 00170 00180 00060 ")
        functions.GEN_STRCAT(ID, "00210 00220 00241 00242 00250 00260 00270 00278 00288 00358 00370 00378 00528 00459 ")
        functions.GEN_STRCAT(ID, "00400 00410 00421 00422 00430 00440 00450 00478 00480 00500 00510 00541 00542 09520 ")
        functions.GEN_STRCAT(ID, "00520 00530 00558 00559 00570 00598 00600 00610 00631 00633 00638 00730 00750 ")
        functions.GEN_STRCAT(ID, "00640 00650 00660 00690 00698 00700 00718 00721 00722 00723 00760 00778 00812 00740 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
        
            if (functions.GEN_AT(untrimmedline.schemaId, "00280") != 0) {
                if (functions.GEN_AT(untrimmedline.eodMets, "1020", 2) == 0)
                    functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 or 20 for Schema ID 00280 if only Mets at DX-Distant LN = 1')
            }
            else {
                if (functions.GEN_AT(untrimmedline.schemaId, "00230") != 0) {
                    if (functions.GEN_AT(untrimmedline.eodMets, "1050", 2) == 0)
                        functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 or 50 for Schema ID 00230 if only Mets at DX-Distant LN = 1')
                }
                else {
                    if (functions.GEN_AT(code, ID, 6) != 0) {
                        if (functions.GEN_AT(untrimmedline.eodMets, "10") == 0)
                            functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 if only Mets at DX-Distant LN = 1')
                    }
                }
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00230") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "1050", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0)
                    functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must= 1 if EOD Mets = 10 or 50 for Schema ID 00230')
            }
        }
        else {
            if (functions.GEN_AT(untrimmedline.schemaId, "00280") != 0) {
                if (functions.GEN_AT(untrimmedline.eodMets, "1020", 2) != 0) {
                    if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0)
                        functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must= 1 if EOD Mets = 10 or 20 for Schema ID 00280')
                }
            }
            else {
                if (functions.GEN_AT(code, ID, 6) != 0) {
                    if (functions.GEN_AT(untrimmedline.eodMets, "10") != 0) {
                        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0)
                            functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 10')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-02520; TAG: N6149; NAME: Mets at DX-BBLLO, EOD Mets, Schema ID (SEER)
    public boolean naaccr02520(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[570]
        char[] code = new char[7]
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets) || functions.GEN_AT(untrimmedline.eodMets, "88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00071 00072 00073 00074 00075 00076 00077 00080 00090 00100 00111 00112 00118 00119 ")
        functions.GEN_STRCAT(ID, "00121 00122 00128 00130 00131 00132 00133 00140 00150 00161 00169 00170 00180 00060 ")
        functions.GEN_STRCAT(ID, "00210 00220 00241 00242 00250 00260 00270 00278 00288 00358 00370 00378 00528 ")
        functions.GEN_STRCAT(ID, "00400 00410 00421 00422 00430 00440 00450 00478 00480 00500 00510 00541 00542 09520 ")
        functions.GEN_STRCAT(ID, "00520 00530 00558 00559 00570 00598 00600 00610 00631 00633 00638 00730 00750 00459 ")
        functions.GEN_STRCAT(ID, "00640 00650 00660 00690 00698 00700 00718 00721 00722 00723 00760 00778 00812 00740 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "70") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02521; TAG: N6150; NAME: Esophagus and EGJ Tumor Epicenter, Esophagus, EOD Primary Site (SEER)
    public boolean naaccr02521(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00161", 5) == 0)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.esophagusAndEgjTumorEpicenter))
            return true
        if (functions.GEN_AT(untrimmedline.primarySite, "C159") != 0) {
            if (functions.GEN_AT(untrimmedline.esophagusAndEgjTumorEpicenter, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Esophagus and EGJ Tumor Epicenter: ${untrimmedline.esophagusAndEgjTumorEpicenter} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "800") != 0) {
            if (functions.GEN_AT(untrimmedline.esophagusAndEgjTumorEpicenter, "9") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Esophagus and EGJ Tumor Epicenter: ${untrimmedline.esophagusAndEgjTumorEpicenter} conflicts with EOD Primary Tumor: ${untrimmedline.eodPrimaryTumor}')
        }
        return true

    }

    // ID: NAACCR-02522; TAG: N6152; NAME: EOD Primary Tumor, Appendix, Histology ICDO3 (SEER)
    public boolean naaccr02522(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        functions.GEN_NOOP()
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00190", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "600", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "848084818490", 4) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02523; TAG: N6153; NAME: EOD Regional Nodes, Appendix, Regional Nodes Positive (SEER)
    public boolean naaccr02523(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00190", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "400") != 0) {
            if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02524; TAG: N6154; NAME: Mets at DX, Appendix, EOD Mets (SEER)
    public boolean naaccr02524(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00190", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxOther, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "103050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10, 30, or 50 if only Mets at DX-Other= 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxOther, "2") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "3050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 or 50 if only Mets at DX-Other= 2')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1", 1) != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "40", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 40 if only Mets at DX-Distant LN = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1", 1) != 0 && functions.GEN_AT(untrimmedline.metsAtDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if Mets at DX-Distant LN = 1, Other = 1 or 2')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 1) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if any Mets at DX-Bone, Brain, Liver, Lung =1')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "10", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxOther, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Other must = 1 if EOD Mets = 10')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "30", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxOther, "12", 1) == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Other must = 1 or 2 if EOD Mets = 30')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "40", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 40')
        }
        return true

    }

    // ID: NAACCR-02525; TAG: N6155; NAME: Tumor Deposits, Colorectal, EOD Regional Nodes, Regional Nodes Positive (SEER)
    public boolean naaccr02525(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00200", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99", "(\\d\\d)") || functions.GEN_AT(untrimmedline.tumorDeposits, "X1X2", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "200") != 0) {
                if (functions.GEN_AT(untrimmedline.regionalNodesPositive, "009899", 2) == 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02526; TAG: N6156; NAME: Mets at DX, Colon/Rectum, EOD Mets (SEER)
    public boolean naaccr02526(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00200", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && (functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "103070", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10, 30, or 70 if only Mets at DX-Distant LN = 1')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && ((((functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "204050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 20, 40, or 50 if only one of Mets at DX-Bone,Brain,Liver,Lung,Other=1 and Distant LN=0')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1", 1) != 0) && ((((functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "304050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30, 40, or 50 if only one of Mets at DX-Bone,Brain,Liver,Lung,Other=1 and Distant LN=1')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "019", 1) != 0) && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0)) || (functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0)) || (functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0)) || (functions.GEN_AT(untrimmedline.metsAtDxLung, "1", 1) != 0 && functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "4050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 40 or 50 if more than one of Mets at DX-Bone,Brain,Liver,Lung,Other =1, w/wo Distant LN')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxOther, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if Mets at DX-Other= 2')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "1030", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 10 or 30')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxOther, "12", 1) == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Other must = 1 or 2 if EOD Mets = 50')
        }
        return true

    }

    // ID: NAACCR-02527; TAG: N6157; NAME: Circumferential Resection Margin (CRM), Colon, Behavior ICDO3 (NAACCR)
    public boolean naaccr02527(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00200", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.circumferentialResectionMargin) || functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.circumferentialResectionMargin, "XX.9") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02528; TAG: N6158; NAME: Tumor Deposits, Colorectal, Behavior (NAACCR)
    public boolean naaccr02528(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00200", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorDeposits) || functions.GEN_AT(untrimmedline.tumorDeposits, "X8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorDeposits, "01-99", "(\\d\\d)") || functions.GEN_AT(untrimmedline.tumorDeposits, "X1X2", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02529; TAG: N6159; NAME: EOD Regional Nodes, Pancreas/NET Pancreas, Primary Site (SEER)
    public boolean naaccr02529(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "0028000340", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "700") != 0) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C251C252", 4) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02530; TAG: N6160; NAME: EOD Mets, Pancreas/NET Pancreas, Primary Site (SEER)
    public boolean naaccr02530(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "0028000340", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00280") != 0) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C250C251C252", 4) == 0) {
                if (functions.GEN_AT(untrimmedline.eodMets, "10") != 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00340") != 0) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C250C251C252", 4) == 0) {
                if (functions.GEN_AT(untrimmedline.eodMets, "20") != 0)
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02531; TAG: N6161; NAME: Mets at DX, Lung, EOD Mets (SEER)
    public boolean naaccr02531(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00360", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if ((functions.GEN_AT(untrimmedline.metsAtDxLung, "1") != 0) && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09") != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "10", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 if only Mets at DX-Lung = 1')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxOther, "1") != 0) && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09") != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "103050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10, 30, or 50 if only Mets at DX-Other = 1 w/wo Lung')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "2050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 20 or 50 if only Mets at DX-Distant LN = 1 w/wo Lung, w/wo Other =1')
        }
        if (((functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther))) && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver))) || ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && functions.GEN_AT(untrimmedline.metsAtDxLiver, "1") != 0))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "3050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 or 50 if only one of Mets at DX-Bone,Brain,Liver = 1, Distant LN= 0')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxBone, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0)) || (functions.GEN_AT(untrimmedline.metsAtDxBrain, "1", 1) != 0 && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1", 1) != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1", 1) != 0)) || (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && functions.GEN_AT(untrimmedline.metsAtDxLiver, "1") != 0) || (functions.GEN_AT(untrimmedline.metsAtDxOther, "2") != 0)) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if Mets at DX-Bone+Brain, Nodes, or Liver = 1, Brain+Nodes or Liver = 1, Nodes + Liver = 1, or Other = 2')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "20") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 20')
        }
        return true

    }

    // ID: NAACCR-02532; TAG: N6162; NAME: EOD Primary Tumor, Lung, Primary Site (SEER)
    public boolean naaccr02532(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00360", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "600") != 0) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C340C348C349", 4) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02533; TAG: N6164; NAME: Visceral and Parietal Pleural Invasion, Lung, Behavior (NAACCR)
    public boolean naaccr02533(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00360", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.visceralParietalPleuralInvasion) || functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.visceralParietalPleuralInvasion, "09", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02534; TAG: N6166; NAME: Mets at DX, Melanoma Skin, EOD Mets (SEER)
    public boolean naaccr02534(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00470", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "10", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 if only Mets at DX-Distant LN = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "20", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 20 if only Mets at DX-Bone = 1 w/wo Distant LN')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxOther, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "2050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 20 or 50 if only Mets at DX-Other = 1 w/wo Bone, Distant LN')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxLung, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "019") != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "30", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 if only Mets at DX-Lung = 1 w/wo Bone, Distant LN')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxLung, "1") != 0 && functions.GEN_AT(untrimmedline.metsAtDxOther, "1") != 0) && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "3050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 or 50 if Mets at DX-Lung and Other = 1 w/wo Bone, Distant LN')
        }
        if ((functions.GEN_AT(untrimmedline.metsAtDxLiver, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "2") != 0) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09") != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if any Mets at DX-Liver = 1, Other = 2')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBrain, "1") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "60", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 60 if Mets at DX-Brain = 1')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "10", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 10')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "30", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxLung, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxLung))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Lung must = 1 if EOD Mets = 30')
        }
        return true

    }

    // ID: NAACCR-02535; TAG: N6167; NAME: EOD Primary Tumor, Breast, Histology ICDO3 (SEER)
    public boolean naaccr02535(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00480", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "050", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8540", 4) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "070", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8543", 4) == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "8541", 4) != 0) {
            if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000050070", 3) != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02536; TAG: N6170; NAME: LN Status Femoral-Inguinal, Para-aortic, Pelvic, Gynecologic, Behavior (NAACCR)
    public boolean naaccr02536(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[35]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021 || dx_year > 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00500 00510 00520 09520 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnStatusFemorInguinParaaortPelv) || functions.GEN_AT(untrimmedline.lnStatusFemorInguinParaaortPelv, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.lnStatusFemorInguinParaaortPelv, "09", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02537; TAG: N6171; NAME: LN Laterality, Vulva, Behavior ICDO3 (NAACCR)
    public boolean naaccr02537(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00500", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lnLaterality) || functions.GEN_AT(untrimmedline.lnLaterality, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.lnLaterality, "09", 1) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-02538; TAG: N6174; NAME: Number of Positive Pelvic Nodes/Positive Para-aortic Nodes, Corpus Uteri, EOD Regional Nodes, CoC Flag (SEER)
    public boolean naaccr02538(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[35]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "1") == 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00528 00530 00541 00542 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(code, ID, 6) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodRegionalNodes))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00530") != 0) {
            if (functions.GEN_INLIST(untrimmedline.numberOfPositivePelvicNodes, "01-99,X1,X2,X6") && functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X8X9", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "100200300", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes} and Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            }
            if (functions.GEN_INLIST(untrimmedline.numberOfPositiveParaAorticNodes, "01-99,X1,X2,X6")) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "400500600", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "005280054100542", 5) != 0) {
            if (functions.GEN_INLIST(untrimmedline.numberOfPositivePelvicNodes, "01-99,X1,X2,X6")) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "300", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            }
            if (functions.GEN_INLIST(untrimmedline.numberOfPositiveParaAorticNodes, "01-99,X1,X2,X6")) {
                if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "300", 3) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} conflicts with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
            }
        }
        if (functions.GEN_AT(untrimmedline.eodRegionalNodes, "000") != 0) {
            if ((functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X8X9", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes)) || (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X8X9", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes)))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Number of Positive Pelvic Nodes: ${untrimmedline.numberOfPositivePelvicNodes} and Number of Positive Para-Aortic Nodes: ${untrimmedline.numberOfPositiveParaAorticNodes} conflict with EOD Regional Nodes: ${untrimmedline.eodRegionalNodes}')
        }
        return true

    }

    // ID: NAACCR-02539; TAG: N6175; NAME: Number of Positive Pelvic Nodes/Positive Para-aortic Nodes, Corpus, Behavior ICDO3 (NAACCR)
    public boolean naaccr02539(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00528005300054100542", 5) == 0)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes) || functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "X8") != 0) && (functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes) || functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "X8") != 0))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if ((functions.GEN_AT(untrimmedline.numberOfPositivePelvicNodes, "00X8X9", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.numberOfPositivePelvicNodes)) || (functions.GEN_AT(untrimmedline.numberOfPositiveParaAorticNodes, "00X8X9", 2) == 0 && !functions.GEN_EMPTY(untrimmedline.numberOfPositiveParaAorticNodes)))
                return false
        }
        return true

    }

    // ID: NAACCR-02540; TAG: N6176; NAME: Mets at DX, Ovarian, EOD Mets (SEER)
    public boolean naaccr02540(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00551 00552 00553 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxOther, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "1050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 or 50 if only Mets at DX-Other = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "30", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 if only Mets at DX-Distant LN = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && functions.GEN_AT(untrimmedline.metsAtDxOther, "1", 1) != 0)) {
            if (functions.GEN_AT(untrimmedline.eodMets, "3050", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 or 50 if Mets at DX-Distant LN and Other = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxBrain, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if any Mets at DX-Bone, Brain, Liver, Lung = 1, Other = 2')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "10") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxOther, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Other must = 1 if EOD Mets = 10')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "30") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 30')
        }
        return true

    }

    // ID: NAACCR-02541; TAG: N6177; NAME: Mets at DX, Placenta, EOD Mets (SEER)
    public boolean naaccr02541(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00560") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxLung, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "10", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 if only Mets at DX-Lung = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "30", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 if only Mets at DX-Distant LN = 1 w/wo Lung')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxBrain, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if any Mets at DX-Bone, Brain, Liver = 1, Other = 1, 2')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "10") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxLung, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxLung))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Lung must = 1 if EOD Mets = 10')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "30") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 30')
        }
        return true

    }

    // ID: NAACCR-02542; TAG: N6178; NAME: Mets at DX, Prostate, EOD Mets (SEER)
    public boolean naaccr02542(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[25]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00580") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.metsAtDxBone) && functions.GEN_EMPTY(untrimmedline.metsAtDxBrain) && functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn) && functions.GEN_EMPTY(untrimmedline.metsAtDxLiver) && functions.GEN_EMPTY(untrimmedline.metsAtDxLung) && functions.GEN_EMPTY(untrimmedline.metsAtDxOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodMets))
            return true
        if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBone, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBone)) && (functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "10", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 10 if only Mets at DX-Distant LN = 1')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1") != 0 && ((functions.GEN_AT(untrimmedline.metsAtDxBrain, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxBrain)) && (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "019", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn)) && (functions.GEN_AT(untrimmedline.metsAtDxLiver, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLiver)) && (functions.GEN_AT(untrimmedline.metsAtDxLung, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxLung)) && (functions.GEN_AT(untrimmedline.metsAtDxOther, "09", 1) != 0 || functions.GEN_EMPTY(untrimmedline.metsAtDxOther)))) {
            if (functions.GEN_AT(untrimmedline.eodMets, "30", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 30 if Mets at DX-Bone = 1 w/wo Distant LN')
        }
        if (functions.GEN_AT(untrimmedline.metsAtDxBrain, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLiver, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxLung, "1") != 0 || functions.GEN_AT(untrimmedline.metsAtDxOther, "12", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.eodMets, "50", 2) == 0)
                functions.GEN_SAVE_TEXT(binding, 'EOD Mets must = 50 if any Mets at DX-Brain, Liver, Lung = 1, Other = 1, 2')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "10") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxDistantLn, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxDistantLn))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Distant LN must = 1 if EOD Mets = 10')
        }
        if (functions.GEN_AT(untrimmedline.eodMets, "30") != 0) {
            if (functions.GEN_AT(untrimmedline.metsAtDxBone, "1") == 0 && !functions.GEN_EMPTY(untrimmedline.metsAtDxBone))
                functions.GEN_SAVE_TEXT(binding, 'Mets at DX-Bone must = 1 if EOD Mets = 30')
        }
        return true

    }

    // ID: NAACCR-02543; TAG: N6179; NAME: EOD Prostate Pathologic Extension, RX Summ--Surg Prim Site (SEER)
    public boolean naaccr02543(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fivemonth
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        fivemonth = functions.GEN_MONTHINTERVAL_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, 0, 5, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7", 1) != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00580", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.prostatePathologicalExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "90,99", "(\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.prostatePathologicalExtension, "900, 950, 999", "(\\d\\d\\d)"))
                return false /*   
        if(dx_year == 2021)
        {
        
        if (INLIST(#S"RX Summ--Surg Prim Site","30-80","dd"))
          if (NOT INLIST(#S"EOD Prostate Pathologic Extension","000-800, 999","ddd"))
           return FAIL;
           
        if (INLIST(#S"RX Summ--Surg Prim Site","00-26","dd"))
          if (NOT INLIST(#S"EOD Prostate Pathologic Extension","900, 950","ddd"))
           return FAIL;
           
        
        if (INLIST(#S"EOD Prostate Pathologic Extension","900, 950","ddd"))
          if(NOT INLIST(#S"RX Summ--Surg Prim Site", "00-26,90,99","dd"))
           return FAIL;
           
        }
         */
        }
        if (dx_year >= 2018) {
        
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "50-80", "(\\d\\d)")) {
                if (!functions.GEN_INLIST(untrimmedline.prostatePathologicalExtension, "000-800, 999", "(\\d\\d\\d)"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-30", "(\\d\\d)")) {
                if (!functions.GEN_INLIST(untrimmedline.prostatePathologicalExtension, "900, 950", "(\\d\\d\\d)"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.prostatePathologicalExtension, "900, 950", "(\\d\\d\\d)")) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-30,90,99", "(\\d\\d)"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-02544; TAG: N6180; NAME: EOD Primary Tumor, Urinary, Histology ICDO3, Behavior ICDO3 (SEER)
    public boolean naaccr02544(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[30]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00610 00620 00631 00633 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodPrimaryTumor))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.eodPrimaryTumor, "000", 3) != 0) {
            if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2", 1) == 0 || functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "81308131", 4) == 0)
                return false
        }
        return true

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy