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

com.imsweb.validation.edits.translated.naaccr.NaaccrTranslatedCompiledRules5.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 NaaccrTranslatedCompiledRules5 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-01135' <= id && id <= 'NAACCR-01410'
    }

    // ID: NAACCR-01135; TAG: N0824; NAME: RX Summ--Hormone (NPCR)
    public boolean naaccr01135(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,01,82,85-88,99", "(\\d\\d)")

    }

    // ID: NAACCR-01136; TAG: N0818; NAME: RX Summ--Hormone, Date of DX (NPCR)
    public boolean naaccr01136(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            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.rxSummHormone))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Hormone cannot be blank')
        }
        return true

    }

    // ID: NAACCR-01137; TAG: N0293; NAME: RX Summ--Hormone, DateDX, RptSrc (SEER IF62)
    public boolean naaccr01137(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (dx_year < 1988) {
            if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,01,88,99", "(\\d\\d)"))
                return true
            else
                return false
        }
        else {
            if ((dx_year >= 1988) && (dx_year <= 2002)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,01,87,88,99", "(\\d\\d)"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 2002) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,01,82,85-88,99", "(\\d\\d)"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01138; TAG: N1250; NAME: RX Summ--Hormone, RX Date Hormone (COC)
    public boolean naaccr01138(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-87")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Hormone = ${untrimmedline.rxSummHormone}, RX Date Hormone Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "01-03")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateHormone))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Hormone = ${untrimmedline.rxSummHormone} and RX Date Hormone is blank, if year of Date of Diagnosis < 2012, RX Date Hormone Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Hormone = ${untrimmedline.rxSummHormone} and RX Date Hormone is blank, if year of Date of Diagnosis > 2011, RX Date Hormone Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "88")) {
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10,11,12,15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Hormone = ${untrimmedline.rxSummHormone} and Date of Diagnosis < 2012, RX Date Hormone Flag must = 10, 11, 12, 15')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Hormone = ${untrimmedline.rxSummHormone} and Date of Diagnosis > 2011, RX Date Hormone Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "99")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Hormone = ${untrimmedline.rxSummHormone}, RX Date Hormone Flag must = 10')
        }
        return true

    }

    // ID: NAACCR-01139; TAG: N0394; NAME: RX Summ--Hormone, RX Text--Hormone (NAACCR)
    public boolean naaccr01139(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "01")) {
            if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextHormone, 1, 79)))
                return false
        }
        return true

    }

    // ID: NAACCR-01140; TAG: N0643; NAME: RX Summ--Hormone, Vital Status (COC)
    public boolean naaccr01140(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_VAL(untrimmedline.rxSummHormone) == 85 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NAACCR-01141; TAG: N0825; NAME: RX Summ--Other (NPCR)
    public boolean naaccr01141(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
        return functions.GEN_INLIST(untrimmedline.rxSummOther, "0-3,6-9")

    }

    // ID: NAACCR-01142; TAG: N0294; NAME: RX Summ--Other (SEER OTHERRX)
    public boolean naaccr01142(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummOther, "0-3,6-9")

    }

    // ID: NAACCR-01143; TAG: N0820; NAME: RX Summ--Other, Date of DX (NPCR)
    public boolean naaccr01143(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            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.rxSummOther))
                return false
        }
        if (dx_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Other cannot be blank')
        }
        return true

    }

    // ID: NAACCR-01144; TAG: N0295; NAME: RX Summ--Other, DateDX, RptSrc (SEER IF64)
    public boolean naaccr01144(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummOther, "0"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummOther, "9"))
                return true
            else
                return false
        }
        if (dx_year < 1988) {
            if (functions.GEN_INLIST(untrimmedline.rxSummOther, "0-3,6,8,9"))
                return true
            else
                return false
        }
        else {
            if (dx_year > 1987) {
                if (functions.GEN_INLIST(untrimmedline.rxSummOther, "0-3,6-9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-01145; TAG: N0193; NAME: RX Summ--Other, RX Date Other (NPCR)
    public boolean naaccr01145(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "11"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummOther, "1-3,6")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateOther))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10, 12"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummOther, "8")) {
            if (dx_year < 2015) {
                if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10,11,12,15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Other = ${untrimmedline.rxSummOther} and Date of Diagnosis < 2015, RX Date Other Flag must = 10, 11, 12, 15')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Other = ${untrimmedline.rxSummOther} and Date of Diagnosis > 2014, RX Date Other Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummOther, "9")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10, 12"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01146; TAG: N0395; NAME: RX Summ--Other, RX Text--Other (NAACCR)
    public boolean naaccr01146(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummOther, "1-3,6")) {
            if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextOther, 1, 79)))
                return false
        }
        return true

    }

    // ID: NAACCR-01147; TAG: N0514; NAME: RX Summ--Palliative Proc (COC)
    public boolean naaccr01147(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummPalliativeProc, "0-7,9"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01148; TAG: N1245; NAME: RX Summ--Palliative Proc (NAACCR)
    public boolean naaccr01148(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummPalliativeProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummPalliativeProc, "0-7,9"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01149; TAG: N0223; NAME: RX Summ--Rad to CNS (SEER RBCNSYS)
    public boolean naaccr01149(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummRadToCns))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "0-1,7-9")

    }

    // ID: NAACCR-01150; TAG: N0235; NAME: RX Summ--Rad to CNS, Prim Site, RptSrc (SEER IF59)
    public boolean naaccr01150(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if ((dx_year < 1988) && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "9") || functions.GEN_EMPTY(untrimmedline.rxSummRadToCns))
                return true
            else
                return false
        }
        else {
            if (((dx_year >= 1988) && (dx_year <= 1997)) || ((dx_year < 1998) && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9941")) {
                    if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                        if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "0"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                            if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "9"))
                                return true
                            else
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "0,1,7-9"))
                                return true
                            else
                                return false
                        }
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "9"))
                        return true
                    else
                        return false
                }
            }
            else {
                if (dx_year > 1997) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "9") || functions.GEN_EMPTY(untrimmedline.rxSummRadToCns))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01152; TAG: N0296; NAME: RX Summ--Radiation (SEER RADIATN)
    public boolean naaccr01152(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummRadiation))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0-9")

    }

    // ID: NAACCR-01153; TAG: N0234; NAME: RX Summ--Radiation, DateDX, RptSrc (SEER IF58)
    public boolean naaccr01153(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 (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        else {
            if (dx_year < 1988 && !functions.GEN_EMPTY(untrimmedline.rxSummRadiation)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0,1,4-6,8,9"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 1987) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0-5, 7-9"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01154; TAG: N0397; NAME: Radiation, RX Text--Radiation (NAACCR)
    public boolean naaccr01154(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.rxSummRadiation, "12345", 1) != 0 || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98")) {
            if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextRadiation, 1, 79)) && functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextRadiationOther, 1, 79)))
                return false
        }
        return true

    }

    // ID: NAACCR-01155; TAG: N0357; NAME: RX Summ--Reconstruct 1st (NAACCR)
    public boolean naaccr01155(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, "0-9"))
            return true
        return false

    }

    // ID: NAACCR-01156; TAG: N0297; NAME: RX Summ--Reconstruct 1st (SEER RECONST)
    public boolean naaccr01156(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummReconstruct1st))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, "0-9"))
            return true
        return false

    }

    // ID: NAACCR-01157; TAG: N0340; NAME: RX Summ--Reconstruct 1st, Date of DX (COC)
    public boolean naaccr01157(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if ((dx_year > 1997) && (dx_year < 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummReconstruct1st))
                return false
        }
        return true

    }

    // ID: NAACCR-01158; TAG: N0253; NAME: RX Summ--Reconstruct 1st, Primary Site (COC)
    public boolean naaccr01158(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        
        char[] Sitegrp = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummReconstruct1st))
            return true
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummReconstruct1st)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_REST98, context.NAACCR_REST98_GROUPCODE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01159; TAG: N0298; NAME: RX Summ--Reconstruct 1st,DateDx,RptSrc (SEER IF81)
    public boolean naaccr01159(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, " "))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, "0"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, "9"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, "0-9"))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummReconstruct1st, " "))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01160; TAG: N0848; NAME: RX Summ--Reg LN Ex,DateDX,RptSrc,ICDO3 (SEER IF97)
    public boolean naaccr01160(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year == 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummRegLnExamined))
                return true
        }
        if ((dx_year < 1998) || (dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummRegLnExamined))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "700, 710-719, 809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9989")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummRegLnExamined, "00,99"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummRegLnExamined, "00"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummRegLnExamined, "99"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummRegLnExamined, "00-99"))
            return true
        else
            return false
        return true

    }

    // ID: NAACCR-01161; TAG: N0255; NAME: RX Summ--Reg LN Examined (COC)
    public boolean naaccr01161(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummRegLnExamined))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummRegLnExamined, "00-90, 95-99", "(\\d\\d)")

    }

    // ID: NAACCR-01162; TAG: N0299; NAME: RX Summ--Reg LN Examined (SEER SURGNODE)
    public boolean naaccr01162(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummRegLnExamined))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummRegLnExamined, "00-90, 95-99", "(\\d\\d)"))
            return true
        
        return true

    }

    // ID: NAACCR-01163; TAG: N0536; NAME: RX Summ--Reg LN Examined, Date of DX (COC)
    public boolean naaccr01163(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummRegLnExamined))
                return false
        }
        return true

    }

    // ID: NAACCR-01164; TAG: N0554; NAME: RX Summ--Scope Reg 98-02 (COC)
    public boolean naaccr01164(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0-9")

    }

    // ID: NAACCR-01165; TAG: N0555; NAME: RX Summ--Scope Reg 98-02, Date of DX (COC)
    public boolean naaccr01165(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
                return false
        }
        return true

    }

    // ID: NAACCR-01166; TAG: N0779; NAME: RX Summ--Scope Reg 98-02, Date of DX (SEER IF98)
    public boolean naaccr01166(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
                return true
            else
                return false
        }
        if ((dx_year >= 1998) && (dx_year <= 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01167; TAG: N0556; NAME: RX Summ--Scope Reg 98-02, Primary Site, ICDO2 (COC)
    public boolean naaccr01167(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[4]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummScopeReg9802)
        
        if (!functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SCOPE98, context.NAACCR_SCOPE98_GROUPCODE, [:]))
            return false
        if (dx_year > 1999) {
            if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "700,710-719,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0,9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-01168; TAG: N0557; NAME: RX Summ--Scope Reg 98-02, Primary Site, ICDO3 (COC)
    public boolean naaccr01168(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[4]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummScopeReg9802)
        
        if (!functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SCOPE98, context.NAACCR_SCOPE98_GROUPCODE, [:]))
            return false
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 1999)) {
            if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9733,9742,9800-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "700,710-719,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0,9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-01169; TAG: N0802; NAME: RX Summ--Scope Reg 98-02,Site,Rpt,ICDO3 (SEER IF79)
    public boolean naaccr01169(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Groupcode = new char[100], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "700, 710-719, 809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9989", "(\\d\\d\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0,9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "9"))
                return true
            else
                return false
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummScopeReg9802)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SCOPE98, context.NAACCR_SCOPE98_GROUPCODE, ['GROUPCODE':Groupcode]))
            return true
        return false

    }

    // ID: NAACCR-01170; TAG: N0252; NAME: RX Summ--Scope Reg LN Sur (COC)
    public boolean naaccr01170(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7, 9")

    }

    // ID: NAACCR-01171; TAG: N0300; NAME: RX Summ--Scope Reg LN Sur (SEER SCOPE)
    public boolean naaccr01171(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7,9"))
            return true
        return false

    }

    // ID: NAACCR-01172; TAG: N0729; NAME: RX Summ--Scope Reg LN Sur, Date of DX (NPCR)
    public boolean naaccr01172(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
                return false
        }
        return true

    }

    // ID: NAACCR-01173; TAG: N0780; NAME: RX Summ--Scope Reg LN Sur, DateDX, RPTSRC (SEER IF100)
    public boolean naaccr01173(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
                return true
            else
                return false
        }
        if (dx_year >= 2001 && dx_year <= 2002 && !functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) {
        
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "90", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "9") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
        }
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
                return false
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "90", 1) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "9") == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Scope Reg LN Sur: ${untrimmedline.rxSummScopeRegLnSur} and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
        }
        return true

    }

    // ID: NAACCR-01174; TAG: N0609; NAME: RX Summ--Scope Reg LN Sur, Site, ICDO2 (COC)
    public boolean naaccr01174(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01175; TAG: N0637; NAME: RX Summ--Scope Reg LN Sur, Site, ICDO3 (SEER IF109)
    public boolean naaccr01175(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 > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                return true
            else
                return false
        }
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-01176; TAG: N0263; NAME: RX Summ--Surg Approch,RX Summ--Surg Site 98-02 (COC)
    public boolean naaccr01176(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalApproch))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalApproch, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgicalApproch, "0"))
                return false
        }
        return true

    }

    // ID: NAACCR-01177; TAG: N0558; NAME: RX Summ--Surg Oth 98-02 (COC)
    public boolean naaccr01177(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "0-9")

    }

    // ID: NAACCR-01178; TAG: N0559; NAME: RX Summ--Surg Oth 98-02, Date of DX (COC)
    public boolean naaccr01178(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
                return false
        }
        return true

    }

    // ID: NAACCR-01179; TAG: N0781; NAME: RX Summ--Surg Oth 98-02, Date of DX (SEER IF99)
    public boolean naaccr01179(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
                return true
            else
                return false
        }
        if ((dx_year >= 1998) && (dx_year <= 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01180; TAG: N0560; NAME: RX Summ--Surg Oth 98-02, Primary Site (COC)
    public boolean naaccr01180(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        
        char[] Sitegrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
            return true
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgOth9802)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SUROTH98, context.NAACCR_SUROTH98_GROUPCODE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01181; TAG: N0803; NAME: RX Summ--Surg Oth 98-02,Site,Rpt,ICDO3 (SEER IF80)
    public boolean naaccr01181(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Groupcode = new char[100], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "700, 710-719, 809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9989", "(\\d\\d\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "0,9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "0"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "9"))
                return true
            else
                return false
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgOth9802)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SUROTH98, context.NAACCR_SUROTH98_GROUPCODE, ['GROUPCODE':Groupcode]))
            return true
        return false

    }

    // ID: NAACCR-01182; TAG: N0254; NAME: RX Summ--Surg Oth Reg/Dis (COC)
    public boolean naaccr01182(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0-5,9")

    }

    // ID: NAACCR-01183; TAG: N0301; NAME: RX Summ--Surg Oth Reg/Dis (SEER SURGOTH)
    public boolean naaccr01183(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0-5,9"))
            return true
        return false

    }

    // ID: NAACCR-01184; TAG: N0730; NAME: RX Summ--Surg Oth Reg/Dis, Date of DX (NPCR)
    public boolean naaccr01184(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
                return false
        }
        return true

    }

    // ID: NAACCR-01185; TAG: N0782; NAME: RX Summ--Surg Oth Reg/Dis, DateDX, RPTSRC (SEER IF101)
    public boolean naaccr01185(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
                return true
            else {
                return false
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return false
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "700, 710-719, 809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993", "(\\d\\d\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01186; TAG: N0124; NAME: RX Summ--Surg Prim Site (COC)
    public boolean naaccr01186(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00, 10-90, 98, 99", "(\\d\\d)")

    }

    // ID: NAACCR-01187; TAG: N0302; NAME: RX Summ--Surg Prim Site (SEER SURGPRIM)
    public boolean naaccr01187(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,10-90, 98, 99"))
            return true
        return false

    }

    // ID: NAACCR-01188; TAG: N0728; NAME: RX Summ--Surg Prim Site, Date of DX (NPCR)
    public boolean naaccr01188(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return false
        }
        return true

    }

    // ID: NAACCR-01189; TAG: N0599; NAME: RX Summ--Surg Prim Site, DateDX, RPTSRC (SEER IF102)
    public boolean naaccr01189(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 1998) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return true
            else
                return false
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return false
            else
                return true
        }
        if (dx_year > 1997) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
                return false
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "6") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "0098", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Surg Prim Site (${untrimmedline.rxSummSurgPrimSite}) and Type of Reporting Source (${untrimmedline.typeOfReportingSource})')
            }
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "9899", 2) == 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Surg Prim Site (${untrimmedline.rxSummSurgPrimSite}) and Type of Reporting Source (${untrimmedline.typeOfReportingSource})')
            }
        }
        return true

    }

    // ID: NAACCR-01190; TAG: N0303; NAME: RX Summ--Surg Prim Site, Diag Conf (SEER IF76)
    public boolean naaccr01190(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSurgDxconf, "1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-90")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1-4"))
                return false
        }
        return true

    }

    // ID: NAACCR-01191; TAG: N0598; NAME: RX Summ--Surg Prim Site, Primary Site, ICDO2 (COC)
    public boolean naaccr01191(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98"))
                return true
            else {
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98"))
                return true
            else
                return false
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP03, context.NAACCR_SITGRP03_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "30")
        }
        else {
            functions.GEN_STRCPY(Sitegrp, "30")
        }
        if (functions.GEN_INLIST(Sitegrp, "30") && functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "41")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                return false
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURG03, context.NAACCR_SURG03_GROUPCODE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01192; TAG: N0596; NAME: RX Summ--Surg Prim Site, Primary Site, ICDO3 (COC)
    public boolean naaccr01192(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        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)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768, 809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98"))
                return true
            else {
                return false
            }
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP03, context.NAACCR_SITGRP03_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "30")
        }
        else {
            functions.GEN_STRCPY(Sitegrp, "30")
        }
        if (functions.GEN_INLIST(Sitegrp, "30") && functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "41")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                return false
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURG03, context.NAACCR_SURG03_GROUPCODE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01193; TAG: N0600; NAME: RX Summ--Surg Prim Site, Site, ICDO3 (SEER IF108)
    public boolean naaccr01193(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        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)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
            return true
        }
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98,99"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98,99"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP03, context.NAACCR_SITGRP03_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "30")
        }
        else {
            functions.GEN_STRCPY(Sitegrp, "30")
        }
        if (functions.GEN_INLIST(Sitegrp, "30") && functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "41")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                return false
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURG03, context.NAACCR_SURG03_GROUPCODE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01194; TAG: N0545; NAME: RX Summ--Surg Site 98-02 (COC)
    public boolean naaccr01194(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00, 10-90, 99", "(\\d\\d)")

    }

    // ID: NAACCR-01195; TAG: N0547; NAME: RX Summ--Surg Site 98-02, Date of DX (COC)
    public boolean naaccr01195(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
                return false
        }
        return true

    }

    // ID: NAACCR-01196; TAG: N0783; NAME: RX Summ--Surg Site 98-02, Date of DX (SEER IF103)
    public boolean naaccr01196(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if ((dx_year < 1998) || (dx_year > 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
                return true
            else
                return false
        }
        if ((dx_year >= 1998) && (dx_year <= 2002)) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01197; TAG: N0635; NAME: RX Summ--Surg Site 98-02, Diag Conf (SEER IF106)
    public boolean naaccr01197(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 < 1998 && dx_year > 2002))
            return true
        if (functions.GEN_AT(untrimmedline.registryId, "0000001544") != 0 && (dx_year == 1998 || dx_year == 1999))
            functions.GEN_NOOP()
        return true
        
        if (functions.GEN_AT(untrimmedline.registryId, "0000001562") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSurgDxconf, "1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4"))
                return false
        }
        return true

    }

    // ID: NAACCR-01198; TAG: N0546; NAME: RX Summ--Surg Site 98-02, Primary Site (COC)
    public boolean naaccr01198(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        
        char[] Sitegrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
            return true
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgSite9802)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURG98, context.NAACCR_SURG98_GROUPCODE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01199; TAG: N0726; NAME: RX Summ--Surg Site 98-02, RX Summ--Surg Site (COC)
    public boolean naaccr01199(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90,99"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "10-90,99")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00"))
                return false
        }
        return true

    }

    // ID: NAACCR-01200; TAG: N0633; NAME: RX Summ--Surg Site 98-02, Site, RptSrc (SEER IF78)
    public boolean naaccr01200(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Groupcode = new char[100], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "99"))
                return true
            else
                return false
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgSite9802)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURG98, context.NAACCR_SURG98_GROUPCODE, ['GROUPCODE':Groupcode]))
            return true
        return false

    }

    // ID: NAACCR-01201; TAG: N0815; NAME: RX Summ--Surg/Rad Seq (NPCR)
    public boolean naaccr01201(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0,2-7,9")

    }

    // ID: NAACCR-01202; TAG: N0224; NAME: RX Summ--Surg/Rad Seq (SEER RADSEQ)
    public boolean naaccr01202(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0,2-7,9")

    }

    // ID: NAACCR-01203; TAG: N2352; NAME: RX Summ--Surg/Rad Seq, Date of DX (NPCR)
    public boolean naaccr01203(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010)
            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")) {
                if (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'If DX year - 2012-2014, Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, RX Summ--Surg/Rad Seq cannot be blank')
            }
        }
        if (dx_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
                return false
        }
        return true

    }

    // ID: NAACCR-01204; TAG: N0304; NAME: RX Summ--Surg/Rad Seq, DateDX, RptSrc (SEER IF60)
    public boolean naaccr01204(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                return true
            else
                return false
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            return true
        }
        if (dx_year < 1988) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0,2-4,9"))
                return true
            else
                return false
        }
        else {
            if (dx_year > 1987 && dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0,2-6,9"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 2011) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0,2-7,9"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01205; TAG: N0225; NAME: RX Summ--Surgery Type (SEER SURGRX)
    public boolean naaccr01205(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgeryType))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "00-99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01206; TAG: N0305; NAME: RX Summ--Surgery Type, Diag Conf (SEER IF46)
    public boolean naaccr01206(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSurgDxconf, "1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "01,02,05-07,10-98", "(\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4"))
                return false
        }
        return true

    }

    // ID: NAACCR-01207; TAG: N0227; NAME: RX Summ--Surgery Type, Radiation (SEER IF44)
    public boolean naaccr01207(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int surg_num
        boolean result
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgeryType))
            return true
        surg_num = functions.GEN_VAL(untrimmedline.rxSummSurgeryType)
        if (surg_num > 9 && (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6") || functions.GEN_INLIST(untrimmedline.rxSummRadToCns, "1"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-6,9"))
                result = true
            else
                result = false
        }
        else {
            if (surg_num < 10 || functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0")) {
                if (functions.GEN_VAL(untrimmedline.rxSummSurgRadSeq) == 0)
                    result = true
                else
                    result = false
            }
            else
                result = true
        }
        return result

    }

    // ID: NAACCR-01208; TAG: N0226; NAME: RX Summ--Surgery Type, Site, RptSrc (SEER IF29)
    public boolean naaccr01208(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int rule_yr, site_num, surg_num
        int dx_year
        
        char[] w_SiteSurg = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (dx_year < 1998)
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (dx_year < 2000)
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562,0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year > 1997) {
            if (!(functions.GEN_EMPTY(untrimmedline.rxSummSurgeryType)))
                return false
            else
                return true
        }
        if (dx_year < 1998) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "00"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "09"))
                        return true
                    else
                        return false
                }
            }
        }
        if (!(functions.GEN_MATCH(untrimmedline.primarySite, "(C\\d\\d\\d)") && functions.GEN_MATCH(untrimmedline.rxSummSurgeryType, "(\\d\\d)")))
            return false /* error flag 359 */
        site_num = functions.GEN_VAL(functions.GEN_RIGHT(untrimmedline.primarySite, 3))
        surg_num = functions.GEN_VAL(untrimmedline.rxSummSurgeryType)
        
        if (site_num >= 540 && site_num <= 549 && dx_year > 1989 && surg_num == 35) {
            return true
        }
        if (site_num >= 530 && site_num <= 539 && ((dx_year > 1989 && surg_num == 35) || (dx_year > 1990 && surg_num == 17))) {
            return true
        }
        if ((site_num >= 700 && site_num <= 729) && (dx_year >= 1992 && dx_year <= 1997) && (surg_num == 35 || surg_num == 55)) {
            return false
        }
        if (site_num >= 440 && site_num <= 449 && !(functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8702-8790", "(\\d\\d\\d\\d)")) && dx_year < 1988 && !(surg_num == 9 || surg_num == 90)) {
            return false
        }
        if (site_num >= 530 && site_num <= 539 && (dx_year > 1987 && surg_num == 15) && (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "2") != 0)) {
            return false
        }
        if (((site_num >= 500 && site_num <= 509) && functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) || functions.GEN_INLIST(untrimmedline.registryId, "0000001529"))
            rule_yr = 1988
        else {
            rule_yr = dx_year
        
            if (rule_yr < 1983) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "09,90"))
                    return false
            }
            else {
                functions.GEN_STRCPY(w_SiteSurg, untrimmedline.primarySite)
                functions.GEN_STRCAT(w_SiteSurg, untrimmedline.rxSummSurgeryType)
        
                if (rule_yr < 1988)
                    return functions.GEN_ILOOKUP(w_SiteSurg, context.NAACCR_IF29_1, context.NAACCR_IF29_1_SITESURG, [:])
                else
                    return functions.GEN_ILOOKUP(w_SiteSurg, context.NAACCR_IF29_2, context.NAACCR_IF29_2_SITESURG, [:])
            }
        }
        return true

    }

    // ID: NAACCR-01209; TAG: N0493; NAME: RX Summ--Surgery, Reason for No Surgery (SEER IF51)
    public boolean naaccr01209(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 > 1997) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgeryType, "01-07", "(\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,2,6-8"))
                return false
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgeryType) > 9) {
            if (functions.GEN_STRCMP(untrimmedline.reasonForNoSurgery, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01210; TAG: N0174; NAME: RX Summ--Surgical Approch (COC)
    public boolean naaccr01210(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalApproch))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummSurgicalApproch, "0-9")

    }

    // ID: NAACCR-01211; TAG: N0576; NAME: RX Summ--Surgical Approch, Date of DX (COC)
    public boolean naaccr01211(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalApproch))
                return false
        }
        return true

    }

    // ID: NAACCR-01212; TAG: N0256; NAME: RX Summ--Surgical Approch, Primary Site (COC)
    public boolean naaccr01212(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        
        char[] Sitegrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalApproch))
            return true
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP98, context.NAACCR_SITGRP98_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "27")
        }
        else
            functions.GEN_STRCPY(Sitegrp, "27")
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgicalApproch)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURAPP98, context.NAACCR_SURAPP98_GROUPCODE, ['GPCODE':Gpcode]))
            return true
        return false

    }

    // ID: NAACCR-01213; TAG: N0069; NAME: RX Summ--Surgical Margins (COC)
    public boolean naaccr01213(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "0-3, 7-9")

    }

    // ID: NAACCR-01214; TAG: N1246; NAME: RX Summ--Surgical Margins (NAACCR)
    public boolean naaccr01214(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgicalMargins))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "0-3, 7-9")

    }

    // ID: NAACCR-01215; TAG: N0608; NAME: RX Summ--Surgical Margins, Primary Site, ICDO2 (COC)
    public boolean naaccr01215(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768, 809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595, 9650-9698, 9702-9717 ")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
            }
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) == 8) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) != 0)
                return false
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) == 0) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) != 8)
                return false
        }
        return true

    }

    // ID: NAACCR-01216; TAG: N0607; NAME: RX Summ--Surgical Margins, Primary Site, ICDO3 (COC)
    public boolean naaccr01216(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 > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.rxSummSurgicalMargins))
            return true
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768, 809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
        }
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
                }
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "9"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'RX Summ--Surgical Margins must = 9 for this site/histology')
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) == 8) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) != 0)
                return false
        }
        if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) == 0) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgicalMargins) != 8)
                return false
        }
        return true

    }

    // ID: NAACCR-01217; TAG: N0757; NAME: RX Summ--Systemic/Sur Seq (COC)
    public boolean naaccr01217(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0,2-7,9")

    }

    // ID: NAACCR-01218; TAG: N0758; NAME: RX Summ--Systemic/Sur Seq, Date of DX (COC)
    public boolean naaccr01218(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2005) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq))
                return false
        }
        return true

    }

    // ID: NAACCR-01220; TAG: N0794; NAME: RX Summ--Systemic/Sur Seq, DateDX, RPTSRC (SEER IF154)0
    public boolean naaccr01220(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006) {
            if (!functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2006, then RX Summ--Systemic/Sur Seq must be blank')
        }
        if (dx_year < 2012) {
            if (functions.GEN_AT(untrimmedline.rxSummSystemicSurSeq, "7") != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} and RX Summ--Systemic/Sur Seq: ${untrimmedline.rxSummSystemicSurSeq}')
        }
        if (dx_year > 2006) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq))
                return false
            if (functions.GEN_AT(untrimmedline.rxSummSystemicSurSeq, "02345679", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Systemic/Sur Seq: ${untrimmedline.rxSummSystemicSurSeq} is not valid for Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
            if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) != 0) {
                if (functions.GEN_AT(untrimmedline.rxSummSystemicSurSeq, "0") == 0)
                    return functions.GEN_ERROR_MSG(binding, 'Conflict between RX Summ--Systemic/Sur Seq: ${untrimmedline.rxSummSystemicSurSeq} and Type of Reporting Source: ${untrimmedline.typeOfReportingSource}')
            }
        }
        return true

    }

    // ID: NAACCR-01221; TAG: N0516; NAME: RX Summ--Transplnt/Endocr (COC)
    public boolean naaccr01221(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00, 10-12, 20, 30, 40, 82, 85-88, 99", "(\\d\\d)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01222; TAG: N0835; NAME: RX Summ--Transplnt/Endocr (NPCR)
    public boolean naaccr01222(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00, 10-12, 20, 30, 40, 82, 85-88, 99", "(\\d\\d)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01223; TAG: N0836; NAME: RX Summ--Transplnt/Endocr, Date of DX (NPCR)
    public boolean naaccr01223(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            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.rxSummTransplntEndocr))
                return false
        }
        if (dx_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Transplnt/Endocr cannot be blank')
        }
        return true

    }

    // ID: NAACCR-01224; TAG: N0601; NAME: RX Summ--Transplnt/Endocr, DateDX, RPTSRC (SEER IF104)
    public boolean naaccr01224(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (dx_year < 2003) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,10-12,20,30,40,87,88,99", "(\\d\\d)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Transplnt/Endocr: ${untrimmedline.rxSummTransplntEndocr} and Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        if (dx_year > 2002) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,10-12,20,30,40,82,85-88,99", "(\\d\\d)"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between RX Summ--Transplnt/Endocr: ${untrimmedline.rxSummTransplntEndocr} and Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        return true

    }

    // ID: NAACCR-01225; TAG: N0597; NAME: RX Summ--Transplnt/Endocr, Primary Site (SEER IF28)
    public boolean naaccr01225(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "30,40")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "500-509,619", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        return true

    }

    // ID: NAACCR-01226; TAG: N0644; NAME: RX Summ--Transplnt/Endocr, Vital Status (COC)
    public boolean naaccr01226(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_VAL(untrimmedline.rxSummTransplntEndocr) == 85 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NAACCR-01227; TAG: N1461; NAME: RX Summ--Treatm Stat, Date 1st Crs RX COC, Class of Case (COC)
    public boolean naaccr01227(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] tx = new char[2]
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus) || functions.GEN_EMPTY(untrimmedline.classOfCase))
            return true
        functions.GEN_STRCPY(tx, untrimmedline.rxSummTreatmentStatus)
        
        if (functions.GEN_AT(untrimmedline.classOfCase, "38") != 0) {
            if (functions.GEN_AT(untrimmedline.rxSummTreatmentStatus, "0") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Class of Case: ${untrimmedline.classOfCase} conflicts with RX Summ--Treatment Status: ${untrimmedline.rxSummTreatmentStatus}')
            if (!functions.GEN_EMPTY(untrimmedline.date1stCrsRxCoc))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Class of Case: ${untrimmedline.classOfCase} and Date 1st Crs RX COC: ${untrimmedline.date1stCrsRxCoc.formatDate()}')
        }
        return true

    }

    // ID: NAACCR-01228; TAG: N1601; NAME: RX Summ--Treatm Stat, Treatment (COC)
    public boolean naaccr01228(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.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.phase1RadiationPrimaryTxVolume, "00") && dx_year < 2018 && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) || (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00") && dx_year < 2018) || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "00") && dx_year >= 2018)))
                        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.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.phase1RadiationPrimaryTxVolume, "99") && dx_year < 2018 && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) || (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "99") && dx_year < 2018) || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "99") && dx_year >= 2018))) {
        
                            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.phase1RadiationPrimaryTxVolume, "00,99") && dx_year < 2018 && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) || (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00,99") && dx_year < 2018) || (functions.GEN_INLIST(untrimmedline.phase1RadiationPrimaryTxVolume, "00,99") && dx_year >= 2018)))
                                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-01229; TAG: N0985; NAME: RX Summ--Treatment Status (COC)
    public boolean naaccr01229(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0-2, 9"))
            return false
        
        return true

    }

    // ID: NAACCR-01230; TAG: N0986; NAME: RX Summ--Treatment Status, Date of DX (COC)
    public boolean naaccr01230(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01231; TAG: N1608; NAME: RX Summ--Treatment Status, Date of DX (NPCR)
    public boolean naaccr01231(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return false
        return true

    }

    // ID: NAACCR-01232; TAG: N0011; NAME: Race 1 (SEER RACE)
    public boolean naaccr01232(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.race1, "01-08, 10-17,20-22,25-28,30-32,96-99", "(\\d\\d)")

    }

    // ID: NAACCR-01234; TAG: N0417; NAME: Race 1, Race 2, Race 3, Race 4, Race 5 (NAACCR)
    public boolean naaccr01234(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int race1, race2, race3, race4, race5
        
        if (functions.GEN_EMPTY(untrimmedline.race2)) {
            if (!functions.GEN_EMPTY(untrimmedline.race3))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = spaces, all subsequent race codes must = spaces')
        }
        if (functions.GEN_EMPTY(untrimmedline.race3)) {
            if (!functions.GEN_EMPTY(untrimmedline.race4))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = spaces, all subsequent race codes must = spaces')
        }
        if (functions.GEN_EMPTY(untrimmedline.race4)) {
            if (!functions.GEN_EMPTY(untrimmedline.race5))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = spaces, all subsequent race codes must = spaces')
        }
        if (functions.GEN_EMPTY(untrimmedline.race2))
            return true
        race1 = functions.GEN_VAL(untrimmedline.race1)
        race2 = functions.GEN_VAL(untrimmedline.race2)
        race3 = functions.GEN_VAL(untrimmedline.race3)
        race4 = functions.GEN_VAL(untrimmedline.race4)
        race5 = functions.GEN_VAL(untrimmedline.race5)
        
        if ((race1 == 99) || (race2 == 99) || (race3 == 99) || (race4 == 99) || (race5 == 99)) {
            if ((race1 != 99) || (race2 != 99) || (race3 != 99) || (race4 != 99) || (race5 != 99))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 99, all race codes must = 99')
        }
        if (race2 == 88) {
            if (race3 != 88)
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 88, all subsequent race codes must = 88')
        }
        if (race3 == 88) {
            if (race4 != 88)
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 88, all subsequent race codes must = 88')
        }
        if (race4 == 88) {
            if (race5 != 88)
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 88, all subsequent race codes must = 88')
        }
        if (functions.GEN_EMPTY(untrimmedline.race1) || functions.GEN_INLIST(untrimmedline.race1, "88,99"))
            return true
        if ((race1 == race2) || (race1 == race3) || (race1 == race4) || (race1 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race2) || race2 == 88)
            return true
        if ((race2 == race3) || (race2 == race4) || (race2 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race3) || race3 == 88)
            return true
        if ((race3 == race4) || (race3 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race4) || race4 == 88)
            return true
        if ((race4 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        return true

    }

    // ID: NAACCR-01235; TAG: N0628; NAME: Race 1, Race 2, Race 3, Race 4, Race 5 (SEER IF93)
    public boolean naaccr01235(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int race1, race2, race3, race4, race5
        
        if (functions.GEN_EMPTY(untrimmedline.race2)) {
            if (!functions.GEN_EMPTY(untrimmedline.race3))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = spaces, all subsequent race codes must = spaces')
        }
        if (functions.GEN_EMPTY(untrimmedline.race3)) {
            if (!functions.GEN_EMPTY(untrimmedline.race4))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = spaces, all subsequent race codes must = spaces')
        }
        if (functions.GEN_EMPTY(untrimmedline.race4)) {
            if (!functions.GEN_EMPTY(untrimmedline.race5))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = spaces, all subsequent race codes must = spaces')
        }
        if (functions.GEN_EMPTY(untrimmedline.race2))
            return true
        race1 = functions.GEN_VAL(untrimmedline.race1)
        race2 = functions.GEN_VAL(untrimmedline.race2)
        race3 = functions.GEN_VAL(untrimmedline.race3)
        race4 = functions.GEN_VAL(untrimmedline.race4)
        race5 = functions.GEN_VAL(untrimmedline.race5)
        
        if ((race1 == 99) || (race2 == 99) || (race3 == 99) || (race4 == 99) || (race5 == 99)) {
            if ((race1 != 99) || (race2 != 99) || (race3 != 99) || (race4 != 99) || (race5 != 99))
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 99, all race codes must = 99')
        }
        if (race2 == 88) {
            if (race3 != 88)
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 88, all subsequent race codes must = 88')
        }
        if (race3 == 88) {
            if (race4 != 88)
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 88, all subsequent race codes must = 88')
        }
        if (race4 == 88) {
            if (race5 != 88)
                return functions.GEN_ERROR_MSG(binding, 'If a race code = 88, all subsequent race codes must = 88')
        }
        if (functions.GEN_EMPTY(untrimmedline.race1) || functions.GEN_INLIST(untrimmedline.race1, "88,99"))
            return true
        if ((race1 == race2) || (race1 == race3) || (race1 == race4) || (race1 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race2) || race2 == 88) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.race1, "01"))
            return functions.GEN_ERROR_MSG(binding, 'A race code of 01 (white) must be the last recorded race')
        if ((race2 == race3) || (race2 == race4) || (race2 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race3) || race3 == 88) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.race2, "01"))
            return functions.GEN_ERROR_MSG(binding, 'A race code of 01 (white) must be the last recorded race')
        if ((race3 == race4) || (race3 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race4) || race4 == 88) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.race3, "01"))
            return functions.GEN_ERROR_MSG(binding, 'A race code of 01 (white) must be the last recorded race')
        if ((race4 == race5))
            return functions.GEN_ERROR_MSG(binding, 'A race code (other than spaces, 88, or 99) must not be entered more than once')
        if (functions.GEN_EMPTY(untrimmedline.race5) || race5 == 88) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.race4, "01"))
            return functions.GEN_ERROR_MSG(binding, 'A race code of 01 (white) must be the last recorded race')
        return true

    }

    // ID: NAACCR-01237; TAG: N0409; NAME: Race 2 (NAACCR)
    public boolean naaccr01237(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.race2))
            return true
        if (functions.GEN_INLIST(untrimmedline.race2, "01-08, 10-17,20-22,25-28,30-32,88,96-99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01238; TAG: N0413; NAME: Race 2, Date of DX (SEER IF89)
    public boolean naaccr01238(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1999) {
            if (functions.GEN_EMPTY(untrimmedline.race2))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01239; TAG: N0410; NAME: Race 3 (NAACCR)
    public boolean naaccr01239(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.race3))
            return true
        if (functions.GEN_INLIST(untrimmedline.race3, "01-08, 10-17,20-22,25-28,30-32,88,96-99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01240; TAG: N0414; NAME: Race 3, Date of DX (SEER IF90)
    public boolean naaccr01240(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1999) {
            if (functions.GEN_EMPTY(untrimmedline.race3))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01241; TAG: N0411; NAME: Race 4 (NAACCR)
    public boolean naaccr01241(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.race4))
            return true
        if (functions.GEN_INLIST(untrimmedline.race4, "01-08, 10-17,20-22,25-28,30-32,88,96-99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01242; TAG: N0415; NAME: Race 4, Date of DX (SEER IF91)
    public boolean naaccr01242(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1999) {
            if (functions.GEN_EMPTY(untrimmedline.race4))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01243; TAG: N0412; NAME: Race 5 (NAACCR)
    public boolean naaccr01243(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.race5))
            return true
        if (functions.GEN_INLIST(untrimmedline.race5, "01-08, 10-17,20-22,25-28,30-32,88,96-99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01244; TAG: N0416; NAME: Race 5, Date of DX (SEER IF92)
    public boolean naaccr01244(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1999) {
            if (functions.GEN_EMPTY(untrimmedline.race5))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01245; TAG: N0857; NAME: Race Coding Sys--Curr, Race Coding Sys--Orig (NAACCR)
    public boolean naaccr01245(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.raceCodingSysCurrent) || functions.GEN_EMPTY(untrimmedline.raceCodingSysOriginal))
            return true
        if (functions.GEN_INLIST(untrimmedline.raceCodingSysCurrent, "9") || functions.GEN_INLIST(untrimmedline.raceCodingSysOriginal, "9"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.raceCodingSysCurrent, untrimmedline.raceCodingSysOriginal) >= 0)
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01246; TAG: N0060; NAME: Race Coding Sys--Current (NAACCR)
    public boolean naaccr01246(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.raceCodingSysCurrent, "7")

    }

    // ID: NAACCR-01247; TAG: N0061; NAME: Race Coding Sys--Original (NAACCR)
    public boolean naaccr01247(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.raceCodingSysOriginal))
            return true
        return functions.GEN_INLIST(untrimmedline.raceCodingSysOriginal, "1,2,3,4,5,6,7,9")

    }

    // ID: NAACCR-01248; TAG: N0584; NAME: Race Coding Sys--Original, Date of Diagnosis (COC)
    public boolean naaccr01248(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.raceCodingSysOriginal))
                return false
        }
        return true

    }

    // ID: NAACCR-01249; TAG: N0958; NAME: Race--NAPIIA(derived API) (NAACCR)
    public boolean naaccr01249(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.raceNapiia))
            return true
        return functions.GEN_INLIST(untrimmedline.raceNapiia, "01-08,10-17,20-22,25-28,30-32,96-99", "(\\d\\d)")

    }

    // ID: NAACCR-01250; TAG: N0517; NAME: Rad--Boost Dose cGy (COC)
    public boolean naaccr01250(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radBoostDoseCgy))
            return true
        if (functions.GEN_MATCH(untrimmedline.radBoostDoseCgy, "(\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01251; TAG: N0518; NAME: Rad--Boost Dose cGy, Date of Diagnosis (COC)
    public boolean naaccr01251(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.radBoostDoseCgy))
                return false
        }
        return true

    }

    // ID: NAACCR-01252; TAG: N0519; NAME: Rad--Boost RX Modality (COC)
    public boolean naaccr01252(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radBoostRxModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.radBoostRxModality, "00,20-32,40-43,50-55,60-62,98,99", "(\\d\\d)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01253; TAG: N0520; NAME: Rad--Boost RX Modality, Date of Diagnosis (COC)
    public boolean naaccr01253(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.radBoostRxModality))
                return false
        }
        return true

    }

    // ID: NAACCR-01254; TAG: N0127; NAME: Rad--Location of RX (COC)
    public boolean naaccr01254(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0-4,8,9"))
            return true
        return false

    }

    // ID: NAACCR-01255; TAG: N1230; NAME: Rad--Location of RX (NAACCR)
    public boolean naaccr01255(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_INLIST(untrimmedline.radLocationOfRx, "0-4,8,9"))
            return true
        return false

    }

    // ID: NAACCR-01256; TAG: N0128; NAME: Rad--No of Treatment Vol (COC)
    public boolean naaccr01256(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol))
            return true
        if (functions.GEN_MATCH(untrimmedline.radNoOfTreatmentVol, "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01257; TAG: N1231; NAME: Rad--No of Treatment Vol (NAACCR)
    public boolean naaccr01257(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol))
            return true
        if (functions.GEN_MATCH(untrimmedline.radNoOfTreatmentVol, "(\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01258; TAG: N0132; NAME: Rad--Regional Dose: cGy (COC)
    public boolean naaccr01258(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
            return true
        if (functions.GEN_MATCH(untrimmedline.radRegionalDoseCgy, "(\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01259; TAG: N1232; NAME: Rad--Regional Dose: cGy (NAACCR)
    public boolean naaccr01259(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
            return true
        if (functions.GEN_MATCH(untrimmedline.radRegionalDoseCgy, "(\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01260; TAG: N0133; NAME: Rad--Regional RX Modality (COC)
    public boolean naaccr01260(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00,20-32,40-43,50-55,60-62,80,85,98,99", "(\\d\\d)") && functions.GEN_MATCH(untrimmedline.radRegionalRxModality, "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01261; TAG: N0826; NAME: Rad--Regional RX Modality (NPCR)
    public boolean naaccr01261(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00,20-32,40-43,50-55,60-62,80,85,98,99", "(\\d\\d)") && functions.GEN_MATCH(untrimmedline.radRegionalRxModality, "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01262; TAG: N0604; NAME: Rad--Regional RX Modality, Date of Diagnosis (COC)
    public boolean naaccr01262(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) {
            if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "80,85"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If year of Diagnosis > 2002, Rad--Regional RX Modality cannot = 80 or 85')
        }
        return true

    }

    // ID: NAACCR-01263; TAG: N1604; NAME: Rad--Regional RX Modality, Date of Diagnosis (NPCR)
    public boolean naaccr01263(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) {
            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.radRegionalRxModality))
                return functions.GEN_ERROR_MSG(binding, 'If DX year - 2012-2014, Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Rad--Regional RX Modality cannot be blank')
        }
        else {
            if (dx_year >= 2015 && dx_year <= 2017) {
                if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
                    return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015-2017, Rad--Regional RX Modality must be reported')
            }
        }
        if (dx_year >= 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2018 or later, Rad--Regional RX Modality must be blank')
        }
        return true

    }

    // ID: NAACCR-01264; TAG: N0574; NAME: Rad--Regional RX Modality, Reason for No Rad (COC)
    public boolean naaccr01264(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.radRegionalRxModality) || functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "20-98")) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0")) {
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "20-98"))
                return false
        }
        return true

    }

    // ID: NAACCR-01265; TAG: N0130; NAME: Rad--Treatment Volume (COC)
    public boolean naaccr01265(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radTreatmentVolume))
            return true
        if (functions.GEN_INLIST(untrimmedline.radTreatmentVolume, "00-41,50,60,98,99") && functions.GEN_MATCH(untrimmedline.radTreatmentVolume, "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01266; TAG: N1233; NAME: Rad--Treatment Volume (NAACCR)
    public boolean naaccr01266(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radTreatmentVolume))
            return true
        if (functions.GEN_INLIST(untrimmedline.radTreatmentVolume, "00-41,50,60,98,99") && functions.GEN_MATCH(untrimmedline.radTreatmentVolume, "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01267; TAG: N0512; NAME: Readm Same Hosp 30 Days (COC)
    public boolean naaccr01267(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.readmSameHosp30Days))
            return true
        if (functions.GEN_INLIST(untrimmedline.readmSameHosp30Days, "0-3,9"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01268; TAG: N0513; NAME: Readm Same Hosp 30 Days, Date of Diagnosis (COC)
    public boolean naaccr01268(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.readmSameHosp30Days))
                return false
        }
        return true

    }

    // ID: NAACCR-01269; TAG: N0131; NAME: Reason for No Radiation (COC)
    public boolean naaccr01269(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0-2,5-9"))
            return true
        return false

    }

    // ID: NAACCR-01270; TAG: N1234; NAME: Reason for No Radiation (NAACCR)
    public boolean naaccr01270(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0-2,5-9"))
            return true
        return false

    }

    // ID: NAACCR-01271; TAG: N1614; NAME: Reason for No Radiation, Date of DX (NPCR)
    public boolean naaccr01271(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2011) {
            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.reasonForNoRadiation))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, Reason for No Radiation cannot be blank')
        }
        return true

    }

    // ID: NAACCR-01272; TAG: N0863; NAME: Reason for No Radiation, RX Date Radiation (NPCR)
    public boolean naaccr01272(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 < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8") != 0) {
            if (functions.GEN_AT(untrimmedline.rxDateRadiationFlag, "15") == 0)
                return functions.GEN_ERROR_MSG(binding, 'If Reason for No Radiation = 8, then RX Date Radiation Flag must = 15')
        }
        if (functions.GEN_AT(untrimmedline.rxDateRadiationFlag, "15") != 0) {
            if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "8") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.rxDateRadiationFlag, "12") != 0 || (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation))) {
            if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") == 0)
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation Flag = 12 or RX Date Radiation is not empty, then Reason for No Radiation must = 0')
        }
        if (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "9") != 0) {
            if (dx_year > 2011) {
                if (functions.GEN_AT(untrimmedline.rxDateRadiationFlag, "10") != 0)
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Reason for No Radiation = ${untrimmedline.reasonForNoRadiation} and Date of Diagnosis > 2011, RX Date Radiation Flag must = 10')
            }
        }
        return true

    }

    // ID: NAACCR-01273; TAG: N0639; NAME: Reason for No Radiation, Vital Status (COC)
    public boolean naaccr01273(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_VAL(untrimmedline.reasonForNoRadiation) == 5 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NAACCR-01274; TAG: N0814; NAME: Reason for No Surgery (NPCR)
    public boolean naaccr01274(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery))
            return true
        return functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0,1,2,5,6,7,8,9")

    }

    // ID: NAACCR-01275; TAG: N0222; NAME: Reason for No Surgery (SEER NCDSURG)
    public boolean naaccr01275(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0,1,2,5,6,7,8,9")

    }

    // ID: NAACCR-01276; TAG: N0812; NAME: Reason for No Surgery, Date of DX (NPCR)
    public boolean naaccr01276(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery))
                return false
        }
        return true

    }

    // ID: NAACCR-01277; TAG: N0834; NAME: Reason for No Surgery, DateDX, RPTSRC (SEER IF57)
    public boolean naaccr01277(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 1988 && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "2"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0,6,8,9"))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (dx_year <= 2002 || (dx_year >= 1984 && dx_year <= 2002 && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
                    if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "2"))
                        return true
                    else
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
                        if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0-2, 6-9"))
                            return true
                        else
                            return false
                    }
                }
            }
        }
        if (dx_year >= 2003 && dx_year <= 2017) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
                if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9"))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Type of Reporting Source: ${untrimmedline.typeOfReportingSource} and Reason for No Surgery: ${untrimmedline.reasonForNoSurgery}')
            }
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0-2, 5-9"))
                return true
            else
                return false
        }
        if (dx_year >= 2018) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
                if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,9"))
                    return true
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict between Type of Reporting Source: ${untrimmedline.typeOfReportingSource} and Reason for No Surgery: ${untrimmedline.reasonForNoSurgery}')
            }
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0-2, 5-9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01278; TAG: N0640; NAME: Reason for No Surgery, Vital Status (COC)
    public boolean naaccr01278(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_VAL(untrimmedline.reasonForNoSurgery) == 5 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NAACCR-01279; TAG: N0062; NAME: Record Type (NAACCR)
    public boolean naaccr01279(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.recordType, "I,C,A,U,M,L")

    }

    // ID: NAACCR-01280; TAG: N0063; NAME: Recurrence Date--1st (COC)
    public boolean naaccr01280(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.recurrenceDate1st))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Recurrence Date--1st : %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-01281; TAG: N1088; NAME: Recurrence Date--1st Flag (NAACCR)
    public boolean naaccr01281(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recurrenceDate1stFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.recurrenceDate1stFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01282; TAG: N0245; NAME: Recurrence Date--1st, Date 1st Crs RX COC (COC)
    public boolean naaccr01282(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.date1stCrsRxCoc) || functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.date1stCrsRxCoc, untrimmedline.recurrenceDate1st, ((Integer)context.NAACCR_GEN_DT_MAX))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.recurrenceDate1st)) {
                functions.GEN_ERROR_TEXT(binding, 'Recurrence Date--1st is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.date1stCrsRxCoc)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp < 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01283; TAG: N1104; NAME: Recurrence Date--1st, Date Flag (NAACCR)
    public boolean naaccr01283(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recurrenceDate1st)) {
            if (!functions.GEN_INLIST(untrimmedline.recurrenceDate1stFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If Recurrence Date--1st is blank, corresponding Recurrence Date--1st Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.recurrenceDate1stFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01284; TAG: N0247; NAME: Recurrence Date--1st, Date Initial RX SEER (NAACCR)
    public boolean naaccr01284(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateInitialRxSeer) || functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateInitialRxSeer, untrimmedline.recurrenceDate1st, ((Integer)context.NAACCR_GEN_DT_MAX))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.recurrenceDate1st)) {
                functions.GEN_ERROR_TEXT(binding, 'Recurrence Date--1st is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateInitialRxSeer)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp < 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01285; TAG: N0246; NAME: Recurrence Date--1st, Date Last Contact (COC)
    public boolean naaccr01285(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.recurrenceDate1st, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.recurrenceDate1st)) {
                functions.GEN_ERROR_TEXT(binding, 'Recurrence Date--1st is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01286; TAG: N0244; NAME: Recurrence Date--1st, Date of Diagnosis (COC)
    public boolean naaccr01286(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis) || functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.recurrenceDate1st, ((Integer)context.NAACCR_GEN_DT_MAX))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.recurrenceDate1st)) {
                functions.GEN_ERROR_TEXT(binding, 'Recurrence Date--1st is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp < 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01287; TAG: N0064; NAME: Recurrence Type--1st (COC)
    public boolean naaccr01287(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.recurrenceType1st, "00,04,06,10,13-17,20-22,25-27,30,36,40,46,51-60,62,70,88,99")

    }

    // ID: NAACCR-01288; TAG: N1235; NAME: Recurrence Type--1st (NAACCR)
    public boolean naaccr01288(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recurrenceType1st))
            return true
        return functions.GEN_INLIST(untrimmedline.recurrenceType1st, "00,04,06,10,13-17,20-22,25-27,30,36,40,46,51-60,62,70,88,99")

    }

    // ID: NAACCR-01289; TAG: N0776; NAME: Recurrence Type--1st, Cancer Status (COC)
    public boolean naaccr01289(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dolc_year
        
        dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (dolc_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dolc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
        if (dolc_year < 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.cancerStatus) || functions.GEN_EMPTY(untrimmedline.recurrenceType1st))
            return true
        if (functions.GEN_INLIST(untrimmedline.recurrenceType1st, "00", "(\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.cancerStatus, "1"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.recurrenceType1st, "70", "(\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.cancerStatus, "2"))
                return false
        }
        return true

    }

    // ID: NAACCR-01290; TAG: N0248; NAME: Recurrence Type--1st, Recurrence Date--1st (COC)
    public boolean naaccr01290(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recurrenceType1st))
            return true
        if (functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
            return true
        if (functions.GEN_INLIST(untrimmedline.recurrenceType1st, "00, 70")) {
            if (!functions.GEN_EMPTY(untrimmedline.recurrenceDate1st))
                return false
        }
        return true

    }

    // ID: NAACCR-01291; TAG: N0727; NAME: Reg Nodes Ex,Pos,Site,Hist ICDO3,Rpt (SEER IF130)
    public boolean naaccr01291(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int beh, lymflg, rnp, rne, dx_year
        boolean kaposi, hematop, lympho, brain, othcns, othill
        char[] hist4c = new char[5]
        
        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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998 || dx_year > 2003)
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        rne = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        beh = functions.GEN_VAL(untrimmedline.behaviorCodeIcdO3)
        
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if ((rne != 99) || (rnp != 99))
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, Regional Nodes Positive and Examined must both = 99')
            else
                return true
        }
        functions.GEN_STRCPY(hist4c, untrimmedline.histologicTypeIcdO3)
        kaposi = functions.GEN_INLIST(hist4c, "9140")
        hematop = functions.GEN_INLIST(hist4c, "9731-9734,9740-9758,9760-9989")
        lympho = functions.GEN_INLIST(hist4c, "9590-9699,9702-9729")
        brain = functions.GEN_MATCH(untrimmedline.primarySite, "(C700)|(C71[0-9])")
        othcns = functions.GEN_MATCH(untrimmedline.primarySite, "(C701)|(C709)|(C72[0-5])|(C72[8-9])")
        othill = functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-5])|(C765)|(C76[7-8])|(C809)|(C42[0-9])|(C77[0-9])")
        
        if ((brain || othcns || othill || hematop || lympho) && (!kaposi)) {
            if ((rnp != 99) || (rne != 99))
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive and Examined must both = 99 for this site/histology')
        }
        if (rne == 0 && rnp != 98)
            return false
        else {
            if (rne >= 1 && rne <= 90) {
                if (rnp == 97 || rnp == 99 || rnp <= rne)
                    return true
                else
                    return false
            }
            else {
                if (rne == 96 || rne == 97 || rne == 98) {
                    if ((rnp >= 0 && rnp <= 96) || (rnp == 97) || (rnp == 99))
                        return true
                    else
                        return false
                }
                else {
                    if (rne == 99) {
                        if (rnp == 99)
                            return true
                        else
                            return false
                    }
                    else {
                        if (rne == 95) {
                            if (rnp == 0 || rnp == 95 || rnp == 97 || rnp == 99)
                                return true
                            else
                                return false
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-01292; TAG: N0118; NAME: Regional Nodes Ex, Reg Nodes Pos (CS)
    public boolean naaccr01292(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int ex, pos, dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2017)
            return true
        ex = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        pos = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        
        if ((dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (ex == 0 && pos != 98)
                return false
            else {
                if (ex >= 1 && ex <= 90) {
                    if (pos == 97 || pos == 99 || pos <= ex)
                        return true
                    else
                        return false
                }
                else {
                    if (ex == 95 || ex == 96 || ex == 97 || ex == 98) {
                        if ((pos >= 0 && pos <= 90) || (pos == 95) || (pos == 97) || (pos == 99))
                            return true
                        else
                            return false
                    }
                    else {
                        if (ex == 99) {
                            if (pos == 99)
                                return true
                            else
                                return false
                        }
                    }
                }
            }
        }
        if ((dx_year > 2009 && dx_year < 2018) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (ex == 0 && pos != 98)
                return false
            else {
                if (ex >= 1 && ex <= 90) {
                    if (pos == 95 || pos == 97 || pos == 99 || pos <= ex)
                        return true
                    else
                        return false
                }
                else {
                    if (ex == 95) {
                        if (pos == 0 || pos == 95 || pos == 99)
                            return true
                        else
                            return false
                    }
                }
            }
            if (ex == 96 || ex == 97 || ex == 98) {
                if ((pos >= 0 && pos <= 90) || (pos == 95) || (pos == 97) || (pos == 99))
                    return true
                else
                    return false
            }
            else {
                if (ex == 99) {
                    if (pos == 99)
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01293; TAG: N0065; NAME: Regional Nodes Examined (COC)
    public boolean naaccr01293(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00-90, 95-99", "(\\d\\d)")

    }

    // ID: NAACCR-01294; TAG: N1247; NAME: Regional Nodes Examined (NAACCR)
    public boolean naaccr01294(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        return functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00-90, 95-99", "(\\d\\d)")

    }

    // ID: NAACCR-01295; TAG: N0605; NAME: Regional Nodes Examined (SEER)
    public boolean naaccr01295(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            return true
        return functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00-99", "(\\d\\d)")

    }

    // ID: NAACCR-01296; TAG: N0066; NAME: Regional Nodes Positive (COC)
    public boolean naaccr01296(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00-90, 95, 97-99", "(\\d\\d)")

    }

    // ID: NAACCR-01297; TAG: N1248; NAME: Regional Nodes Positive (NAACCR)
    public boolean naaccr01297(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        return functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00-90, 95, 97-99", "(\\d\\d)")

    }

    // ID: NAACCR-01298; TAG: N0606; NAME: Regional Nodes Positive (SEER)
    public boolean naaccr01298(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        return functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00-99", "(\\d\\d)")

    }

    // ID: NAACCR-01299; TAG: N0067; NAME: Registry ID (NAACCR)
    public boolean naaccr01299(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.registryId, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")

    }

    // ID: NAACCR-01300; TAG: N0068; NAME: Registry Type (NAACCR)
    public boolean naaccr01300(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.registryType, "1,2,3")

    }

    // ID: NAACCR-01301; TAG: N0119; NAME: Registry Type, Registry ID (NAACCR)
    public boolean naaccr01301(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.registryType, "1,2"))
            return functions.GEN_LOOKUP(untrimmedline.registryId, context.NAACCR_REGID10, context.NAACCR_REGID10_REGID, [:])
        return true

    }

    // ID: NAACCR-01302; TAG: N0178; NAME: Registry Type, Sequence Number--Central (NAACCR)
    public boolean naaccr01302(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.registryType, "(1)|(2)") && functions.GEN_EMPTY(untrimmedline.sequenceNumberCentral))
            return false
        else
            return true
        
        return true

    }

    // ID: NAACCR-01303; TAG: N0179; NAME: Registry Type, Sequence Number--Hospital (NAACCR)
    public boolean naaccr01303(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.registryType, "(3)") && functions.GEN_EMPTY(untrimmedline.sequenceNumberHospital))
            return false
        else
            return true
        
        return true

    }

    // ID: NAACCR-01304; TAG: N0161; NAME: Reporting Facility (COC)
    public boolean naaccr01304(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.reportingFacility, "0010,0020,0006", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)", 1, 4))
            return true
        return false

    }

    // ID: NAACCR-01305; TAG: N0844; NAME: Reporting Facility (NPCR)
    public boolean naaccr01305(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.reportingFacility, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")

    }

    // ID: NAACCR-01306; TAG: N0777; NAME: RuralUrban Continuum 1993 (NAACCR)
    public boolean naaccr01306(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ruralurbanContinuum1993))
            return true
        if (functions.GEN_INLIST(untrimmedline.ruralurbanContinuum1993, "00-09,98,99", "(\\d\\d)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01307; TAG: N0778; NAME: RuralUrban Continuum 2003 (NAACCR)
    public boolean naaccr01307(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ruralurbanContinuum2003))
            return true
        if (functions.GEN_INLIST(untrimmedline.ruralurbanContinuum2003, "01-09,98,99", "(\\d\\d)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01308; TAG: N0077; NAME: SEER Coding Sys--Current (NAACCR)
    public boolean naaccr01308(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "0-9,A,B,C,D,E,F,G,H,I")

    }

    // ID: NAACCR-01309; TAG: N0921; NAME: SEER Coding Sys--Current (SEER)
    public boolean naaccr01309(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerCodingSysCurrent))
            return true
        return functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "0-9,A,B,C,D,E,F,G,H,I")

    }

    // ID: NAACCR-01310; TAG: N0813; NAME: SEER Coding Sys--Current, Date of DX (SEER)
    public boolean naaccr01310(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year > 2003) && (dx_year < 2007)) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "7"))
                return false
        }
        if (dx_year == 2007) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "8,9"))
                return false
        }
        if (dx_year == 2008 || dx_year == 2009) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "9"))
                return false
        }
        if (dx_year == 2010) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "A"))
                return false
        }
        if (dx_year == 2011) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "B"))
                return false
        }
        if (dx_year == 2012) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "C"))
                return false
        }
        if (dx_year == 2013) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "D"))
                return false
        }
        if (dx_year == 2014) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "E"))
                return false
        }
        if (dx_year == 2015) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "F"))
                return false
        }
        if (dx_year > 2015 && dx_year < 2018) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "G"))
                return false
        }
        if (dx_year > 2017) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "H"))
                return false
        }
        if (dx_year > 2020) {
            if (!functions.GEN_INLIST(untrimmedline.seerCodingSysCurrent, "I"))
                return false
        }
        return true

    }

    // ID: NAACCR-01311; TAG: N0078; NAME: SEER Coding Sys--Original (NAACCR)
    public boolean naaccr01311(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.seerCodingSysOriginal, "0-9,A,B,C,D,E,F,G,H,I")

    }

    // ID: NAACCR-01312; TAG: N0922; NAME: SEER Coding Sys--Original (SEER)
    public boolean naaccr01312(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerCodingSysOriginal))
            return true
        return functions.GEN_INLIST(untrimmedline.seerCodingSysOriginal, "0-9,A,B,C,D,E,F,G,H,I")

    }

    // ID: NAACCR-01313; TAG: N0494; NAME: SEER Record Number (SEER RECNUM)
    public boolean naaccr01313(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerRecordNumber))
            return true
        if (functions.GEN_MATCH(untrimmedline.seerRecordNumber, "(\\d\\d)") && functions.GEN_VAL(untrimmedline.seerRecordNumber) > 0)
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01314; TAG: N0810; NAME: SEER Submission Edit 01 (SEER)
    public boolean naaccr01314(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDx))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'County at DX not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.nhiaDerivedHispOrigin))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'NHIA Derived Hisp Origin not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Histologic Type ICD-O-3 not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Behavior Code ICD-O-3 not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.recordNumberRecode))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Record Number Recode not valid for submission')
        if (functions.GEN_EMPTY(untrimmedline.icdRevisionNumber))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'ICD Revision Number not valid for submission')
        return true

    }

    // ID: NAACCR-01315; TAG: N0850; NAME: SEER Submission Edit 02 (SEER)
    public boolean naaccr01315(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year >= 1992) && (dx_year <= 2000) && !functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3"))
                return functions.GEN_ERROR_MSG(binding, 'Behavior (92-00) ICD-O-2 must be 2 or 3')
        }
        if ((dx_year >= 2001) && (dx_year <= 2003)) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
                return functions.GEN_ERROR_MSG(binding, 'Behavior Code ICD-O-3 must be 2 or 3')
        }
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001542")) {
            if (dx_year < 2000) {
                if (functions.GEN_EMPTY(untrimmedline.maritalStatusAtDx))
                    return true
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.maritalStatusAtDx))
            return functions.GEN_ERROR_MSG(binding, 'Marital Status must not be blank')
        return true

    }

    // ID: NAACCR-01316; TAG: N0079; NAME: SEER Type of Follow-Up (SEER TYPEFUP)
    public boolean naaccr01316(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerTypeOfFollowUp))
            return true
        return functions.GEN_INLIST(untrimmedline.seerTypeOfFollowUp, "1-4")

    }

    // ID: NAACCR-01317; TAG: N1697; NAME: Secondary Diagnosis 1 (COC)
    public boolean naaccr01317(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis1)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "0000000"))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070,U071,Z751,Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis1, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis1, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01318; TAG: N1695; NAME: Secondary Diagnosis 1 - 10 (COC)
    public boolean naaccr01318(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.secondaryDiagnosis1, "0000000")) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis2))
                return functions.GEN_ERROR_MSG(binding, 'If Secondary Diagnosis 1 = 0000000, then subsequent Secondary Diagnosis items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis2)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis3))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis3)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis4))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis4)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis5))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis5)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis6))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis6)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis7))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis7)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis8))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis8)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis9))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis9)) {
            if (!functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis10))
                return functions.GEN_ERROR_MSG(binding, 'If any Secondary Diagnosis items are blank, subsequent items must be blank')
        }
        return true

    }

    // ID: NAACCR-01319; TAG: N1734; NAME: Secondary Diagnosis 10 (COC)
    public boolean naaccr01319(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis10)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z7151,Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis10, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis10, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01320; TAG: N1726; NAME: Secondary Diagnosis 2 (COC)
    public boolean naaccr01320(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis2)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751,Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis2, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis2, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01321; TAG: N1727; NAME: Secondary Diagnosis 3 (COC)
    public boolean naaccr01321(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis3)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751, Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis3, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis3, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01322; TAG: N1728; NAME: Secondary Diagnosis 4 (COC)
    public boolean naaccr01322(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis4)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751,Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis4, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis4, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01323; TAG: N1729; NAME: Secondary Diagnosis 5 (COC)
    public boolean naaccr01323(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis5)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751, Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis5, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis5, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01324; TAG: N1730; NAME: Secondary Diagnosis 6 (COC)
    public boolean naaccr01324(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis6)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751,Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis6, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis6, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01325; TAG: N1731; NAME: Secondary Diagnosis 7 (COC)
    public boolean naaccr01325(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis7)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751, Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis7, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis7, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01326; TAG: N1732; NAME: Secondary Diagnosis 8 (COC)
    public boolean naaccr01326(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis8)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751, Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis8, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis8, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01327; TAG: N1733; NAME: Secondary Diagnosis 9 (COC)
    public boolean naaccr01327(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_dx_value = new char[8]
        
        functions.GEN_STRCPY(t_dx_value, untrimmedline.secondaryDiagnosis9)
        
        if (functions.GEN_EMPTY(t_dx_value))
            return true
        if (functions.GEN_INLIST(t_dx_value, "U070, U071,Z751,Z752,Z753")) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.secondaryDiagnosis9, "([A-Z]\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return false
        }
        if (functions.GEN_MATCH(untrimmedline.secondaryDiagnosis9, "(((A)|(B)|(E)|([G-P])|(R)|(S))\\d[A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")) {
            return true
        }
        if ((functions.GEN_STRCMP(t_dx_value, "T36    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "T50996Z") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Y62    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Y849ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z1401  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z229ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z681   ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z6854ZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z80    ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z809ZZZ") <= 0))
            return true
        if ((functions.GEN_STRCMP(t_dx_value, "Z8500  ") >= 0) && (functions.GEN_STRCMP(t_dx_value, "Z9989ZZ") <= 0))
            return true
        return false

    }

    // ID: NAACCR-01328; TAG: N0448; NAME: Seq Num--Central, Prim Site, Morph ICDO3 (SEER IF22)
    public boolean naaccr01328(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.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88,98")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.overRideIllDefineSite, "1") && functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "01-99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "760-768,809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "0000-9589", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9729,9735-9738,9811-9819,9823,9826-9827,9837", "(\\d\\d\\d\\d)"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420-424", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740-9759", "(\\d\\d\\d\\d)"))
                return false /* fail edit*/
        }
        return true

    }

    // ID: NAACCR-01329; TAG: N0398; NAME: Seq Num--Hosp, Primary Site, Morph ICDO2 (NAACCR)
    public boolean naaccr01329(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "60-88")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.overRideHospseqSite, "1") && functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "01-99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "760-768,809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "0000-9589", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9717", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420-424", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9941", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720-9723,9740-9741", "(\\d\\d\\d\\d)"))
                return false
        }
        return true

    }

    // ID: NAACCR-01330; TAG: N0447; NAME: Seq Num--Hosp, Primary Site, Morph ICDO3 (NAACCR)
    public boolean naaccr01330(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.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "60-88")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.overRideHospseqSite, "1") && functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "01-99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "760-768,809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "0000-9589", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9729,9735-9738,9811-9819,9823,9826-9827,9837", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420-424", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993", "(\\d\\d\\d\\d)"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740-9759", "(\\d\\d\\d\\d)"))
                return false
        }
        return true

    }

    // ID: NAACCR-01331; TAG: N0228; NAME: Sequence Number--Central (SEER SEQUENC)
    public boolean naaccr01331(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,60-88,98,99", "(\\d\\d)")

    }

    // ID: NAACCR-01332; TAG: N0126; NAME: Sequence Number--Hospital (COC)
    public boolean naaccr01332(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59, 60-88,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01333; TAG: N0330; NAME: Sequence Number--Hospital (NAACCR)
    public boolean naaccr01333(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.sequenceNumberHospital))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59, 60-88, 99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01334; TAG: N0012; NAME: Sex (SEER Sex)
    public boolean naaccr01334(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.sex, "1-6,9")

    }

    // ID: NAACCR-01335; TAG: N0013; NAME: Sex, Primary Site (SEER IF17)
    public boolean naaccr01335(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.sex, "1,9") && functions.GEN_INLIST(untrimmedline.primarySite, "510-589", "(C\\d\\d\\d)", 2, 3)) {
            return false
        }
        if (functions.GEN_INLIST(untrimmedline.sex, "2,9") && functions.GEN_INLIST(untrimmedline.primarySite, "600-639", "(C\\d\\d\\d)", 2, 3))
            return false
        return true

    }

    // ID: NAACCR-01336; TAG: N0080; NAME: Site (1973-91) ICD-O-1 (NAACCR OLDSITE)
    public boolean naaccr01336(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] code = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.siteIcdO1))
            return true
        if (!functions.GEN_MATCH(untrimmedline.siteIcdO1, "(1\\d\\d\\d)"))
            return false
        functions.GEN_STRCPY(code, functions.GEN_SUBSTR(untrimmedline.siteIcdO1, 2, 3))
        
        if (functions.GEN_ILOOKUP(code, context.NAACCR_OLDSITE, context.NAACCR_OLDSITE_OLDSITE, [:]))
            return true
        return false

    }

    // ID: NAACCR-01337; TAG: N0081; NAME: Site (1973-91), Date of Diagnosis (SEER IF69)
    public boolean naaccr01337(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "41,44", "(00000015\\d\\d)", 9, 2)) {
            if (dx_year < 1992)
                return true
        }
        if (dx_year < 1992) {
            if (functions.GEN_EMPTY(untrimmedline.siteIcdO1))
                return false
            else
                return true
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.siteIcdO1))
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01338; TAG: N0858; NAME: Site Coding Sys--Curr, Site Coding Sys--Orig (NAACCR)
    public boolean naaccr01338(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.siteCodingSysCurrent) || functions.GEN_EMPTY(untrimmedline.siteCodingSysOriginal))
            return true
        if (functions.GEN_INLIST(untrimmedline.siteCodingSysCurrent, "9") || functions.GEN_INLIST(untrimmedline.siteCodingSysOriginal, "9"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.siteCodingSysCurrent, untrimmedline.siteCodingSysOriginal) >= 0)
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01339; TAG: N0082; NAME: Site Coding Sys--Current (NAACCR)
    public boolean naaccr01339(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.siteCodingSysCurrent, "4,5")

    }

    // ID: NAACCR-01340; TAG: N0859; NAME: Site Coding Sys--Current, Date of DX (NAACCR)
    public boolean naaccr01340(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] str = new char[2]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.siteCodingSysCurrent))
            return true
        functions.GEN_STRCPY(str, functions.GEN_SUBSTR(untrimmedline.primarySite, 1, 1))
        
        if (functions.GEN_INLIST(str, "C")) {
            if (!functions.GEN_INLIST(untrimmedline.siteCodingSysCurrent, "4,5"))
                return false
        }
        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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1991) {
            if (!functions.GEN_INLIST(untrimmedline.siteCodingSysCurrent, "4,5"))
                return false
        }
        if (dx_year > 1987) {
            if (!functions.GEN_INLIST(untrimmedline.siteCodingSysCurrent, "3,4,5"))
                return false
        }
        return true

    }

    // ID: NAACCR-01341; TAG: N0083; NAME: Site Coding Sys--Original (NAACCR)
    public boolean naaccr01341(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.siteCodingSysOriginal))
            return true
        return functions.GEN_INLIST(untrimmedline.siteCodingSysOriginal, "1-6,9")

    }

    // ID: NAACCR-01342; TAG: N0860; NAME: Site Coding Sys--Original, Date of DX (NAACCR)
    public boolean naaccr01342(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.siteCodingSysOriginal))
            return true
        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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (!functions.GEN_INLIST(untrimmedline.siteCodingSysOriginal, "4,5"))
                return false
        }
        return true

    }

    // ID: NAACCR-01343; TAG: N0583; NAME: Site Coding Sys--Original, Date of Diagnosis (COC)
    public boolean naaccr01343(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.siteCodingSysOriginal))
                return false
        }
        return true

    }

    // ID: NAACCR-01344; TAG: N0172; NAME: Social Security Number (SEER)
    public boolean naaccr01344(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.socialSecurityNumber))
            return true
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(999999999)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(000000000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(000\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d\\d\\d0000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(666\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d00\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(9\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01345; TAG: N0399; NAME: Social Security Number (NAACCR)
    public boolean naaccr01345(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(999999999)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(000000000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(000\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d\\d\\d0000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(666\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d00\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(9\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01346; TAG: N0400; NAME: Social Security Number, Date of Diagnosis (COC)
    public boolean naaccr01346(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.socialSecurityNumber))
                return false
        }
        return true

    }

    // ID: NAACCR-01347; TAG: N1799; NAME: Social Security Number-Partial (NAACCR)
    public boolean naaccr01347(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(999999999)")) {
            return true
        }
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(000000000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(000\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d\\d\\d0000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(666\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d00\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(9\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            return true
        }
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\s\\s\\s\\s\\s0000)"))
            return false
        if (functions.GEN_MATCH(untrimmedline.socialSecurityNumber, "(\\s\\s\\s\\s\\s\\d\\d\\d\\d)"))
            return true
        return false

    }

    // ID: NAACCR-01348; TAG: N0014; NAME: Spanish/Hispanic Origin (SEER SPANORIG)
    public boolean naaccr01348(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.spanishHispanicOrigin, "0-9")

    }

    // ID: NAACCR-01349; TAG: N1033; NAME: Spanish/Hispanic Origin, NHIA Derived (NAACCR)
    public boolean naaccr01349(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nhiaDerivedHispOrigin))
            return true
        if (functions.GEN_INLIST(untrimmedline.spanishHispanicOrigin, "1-5,8")) {
            if (functions.GEN_VAL(untrimmedline.spanishHispanicOrigin) != functions.GEN_VAL(untrimmedline.nhiaDerivedHispOrigin))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01350; TAG: N0920; NAME: Spanish/Hispanic Origin, NHIA Derived (SEER IF183)
    public boolean naaccr01350(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.spanishHispanicOrigin, "1-5,8")) {
            if (functions.GEN_VAL(untrimmedline.spanishHispanicOrigin) != functions.GEN_VAL(untrimmedline.nhiaDerivedHispOrigin))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01351; TAG: N1089; NAME: Subsq RX 2ndCrs Date Flag (NAACCR)
    public boolean naaccr01351(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.subsqRx2ndcrsDateFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.subsqRx2ndcrsDateFlag, "10,11"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01352; TAG: N1090; NAME: Subsq RX 3rdCrs Date Flag (NAACCR)
    public boolean naaccr01352(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.subsqRx3rdcrsDateFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.subsqRx3rdcrsDateFlag, "10,11"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01353; TAG: N1091; NAME: Subsq RX 4thCrs Date Flag (NAACCR)
    public boolean naaccr01353(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.subsqRx4thcrsDateFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.subsqRx4thcrsDateFlag, "10,11"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01354; TAG: N0716; NAME: Summ Stg 1977, Site, Hist ICDO2, Class (NAACCR)
    public boolean naaccr01354(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2) || functions.GEN_EMPTY(untrimmedline.classOfCase))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else {
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only; SEER Summary Stage 1977 must = 9')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8800-9055,9110-9134,9141-9507,9520-9581")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "5,7,9"))
                    return true
                else
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9731,9740,9764,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720-9989")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608-609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9700-9701")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9510-9514")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "380-384,388,390-399,470-479,480-488,490-499", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "400-403,408-409,410-414,418-419", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "751-753", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0-2,5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420-429,760-765,767,768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Unknown or Ill-Defined Site; SEER Summary Stage 1977 must = 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8530")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,3,5"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0-5,7,9"))
            return true
        else
            return false
        return true

    }

    // ID: NAACCR-01355; TAG: N0711; NAME: Summ Stg 1977, Site, Hist ICDO2, Rpt Srce (NAACCR)
    public boolean naaccr01355(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else {
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only; SEER Summary Stage 1977 must = 9')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8800-9055,9110-9134,9141-9507,9520-9581")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "5,7,9"))
                    return true
                else
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9731,9740,9764,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720-9989")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608-609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9700-9701")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9510-9514")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "380-384,388,390-399,470-479,480-488,490-499", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "400-403,408-409,410-414,418-419", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1-5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "751-753", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0-2,5,7,9"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420-429,760-765,767,768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Unknown or Ill-Defined Site; SEER Summary Stage 1977 must = 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8530")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,3,5"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0-5,7,9"))
            return true
        else
            return false
        return true

    }

    // ID: NAACCR-01356; TAG: N1617; NAME: Summ Stg 2000, Site, Hist ICDO3, Class (NAACCR)
    public boolean naaccr01356(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.classOfCase))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
                return true
            else {
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only; SEER Summary Stage 2000 must = 9')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9738, 9811-9818,9837") && !functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 5, 7, or 9')
            }
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9823,9827") && !functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424,441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 5, 7, or 9')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9738,9811-9818, 9820-9837") && functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732")) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734")) {
                    if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740,9750-9752,9755-9758,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9764")) {
            if (dx_year < 2010) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2010, Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis > 2009,Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731-9992")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-4,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-4, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608-609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9700-9701")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "380-384,388,390-399,470-479,480-488,490-499", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "400-403,408-409,410-414,418-419", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "751-753", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-2,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 0-2, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420-429,760-765,767,768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Unknown or Ill-Defined Site; SEER Summary Stage 2000 must = 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8530")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "2,4,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 2, 4, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-5,7,9"))
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 0-5, 7, or 9')
        return true

    }

    // ID: NAACCR-01357; TAG: N1616; NAME: Summ Stg 2000, Site, Hist ICDO3, Rpt Srce (NAACCR)
    public boolean naaccr01357(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
                return true
            else {
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only; SEER Summary Stage 2000 must = 9')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9738, 9811-9818,9837") && !functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 5, 7, or 9')
            }
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9823,9827") && !functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424,441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "5,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 5, 7, or 9')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9738,9811-9818, 9820-9837") && functions.GEN_INLIST(untrimmedline.primarySite, "441,690,695-696", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732")) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734")) {
                    if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740,9750-9752,9755-9758,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9764")) {
            if (dx_year < 2010) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,7,9"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2010, Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 7, or 9')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis > 2009,Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731-9992")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 7')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-4,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-4, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-601,608-609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9700-9701")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "692,699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "380-384,388,390-399,470-479,480-488,490-499", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "400-403,408-409,410-414,418-419", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1-5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1-5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-729", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "1,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 1, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "751-753", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-2,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 0-2, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420-429,760-765,767,768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Unknown or Ill-Defined Site; SEER Summary Stage 2000 must = 9')
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "50", "(C\\d\\d\\d)", 2, 2) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8530")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "2,4,5,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 2, 4, 5, 7, or 9')
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-5,7,9"))
            return true
        else
            return functions.GEN_ERROR_MSG(binding, 'If Primary Site = ${untrimmedline.primarySite} and Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, SEER Summary Stage 2000 must = 0-5, 7, or 9')
        return true

    }

    // ID: NAACCR-01358; TAG: N0202; NAME: Summary Stage 1977 (NAACCR)
    public boolean naaccr01358(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        return functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0-5,7-9")

    }

    // ID: NAACCR-01359; TAG: N0580; NAME: Summary Stage 1977, Class of Case (COC)
    public boolean naaccr01359(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01360; TAG: N0502; NAME: Summary Stage 1977, Date DX, Date 1st Cont (NAACCR)
    public boolean naaccr01360(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fc_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year != ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (dx_year < 2001) {
                if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2001, SEER Summary Stage 1977 cannot be blank')
                else
                    return true
            }
            else
                return true
        }
        fc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (fc_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (fc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
        if (fc_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is unknown and Date of 1st Contact < 2001, then SEER Summary Stage 1977 cannot be blank')
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01361; TAG: N0436; NAME: Summary Stage 1977, Date of Diagnosis (NAACCR)
    public boolean naaccr01361(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))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                return false
        }
        if (dx_year > 2017) {
            if (!functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If year of Date of Diagnosis >= 2018, then SEER Summary Stage 1977 must be blank')
        }
        return true

    }

    // ID: NAACCR-01362; TAG: N0401; NAME: Summary Stage 1977, EOD--LN Involv, ICDO2 (NAACCR)
    public boolean naaccr01362(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977) || functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717"))
            return true
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,2")) {
            if (functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "1-8"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4")) {
            if (functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0"))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01363; TAG: N0346; NAME: Summary Stage 1977, Histology ICDO2 (COC)
    public boolean naaccr01363(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9941, 9732, 9722")) {
            if (functions.GEN_VAL(untrimmedline.seerSummaryStage1977) != 7)
                return false
        }
        return true

    }

    // ID: NAACCR-01364; TAG: N0345; NAME: Summary Stage 1977, Primary Site-Ed 4, ICDO2 (COC)
    public boolean naaccr01364(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) != 4)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,300,301,311,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,570-574,577-579,589,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "691,699,701,709,720-725,728,729", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750-755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                return false
        }
        return true

    }

    // ID: NAACCR-01365; TAG: N0344; NAME: Summary Stage 1977, Primary Site-Ed 5, ICDO2 (COC)
    public boolean naaccr01365(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) != 5)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,300,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "691,699,700-701,709-719,720-725,728,729", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750-755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                return false
        }
        return true

    }

    // ID: NAACCR-01366; TAG: N0479; NAME: Summary Stage 1977, Regional Nodes Pos (NAACCR)
    public boolean naaccr01366(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsNodespos, "1"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage1977) > 4)
            return true
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,2")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00"))
                return false
            else {
                if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "99"))
                    return true
                else
                    return true
            }
        }
        return true

    }

    // ID: NAACCR-01367; TAG: N0496; NAME: Summary Stage 1977, Summary Stage 2000 (NAACCR)
    public boolean naaccr01367(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2003)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977) && functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return false
        return true

    }

    // ID: NAACCR-01368; TAG: N0481; NAME: Summary Stage 1977, TNM M (NAACCR)
    public boolean naaccr01368(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] MCODE = new char[5]
        char[] MCODE1 = new char[2]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmM, "1"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathM)) {
            functions.GEN_STRCPY(MCODE, untrimmedline.tnmPathM)
            if (functions.GEN_INLIST(MCODE, "88,X")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88,X"))
                        functions.GEN_STRCPY(MCODE, untrimmedline.tnmClinM)
                }
            }
        }
        else
            functions.GEN_STRCPY(MCODE, untrimmedline.tnmClinM)
        functions.GEN_STRCPY(MCODE1, MCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,3,9")) {
            if (functions.GEN_INLIST(MCODE1, "1"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "2,4,5")) {
            if (functions.GEN_INLIST(MCODE1, "1"))
                return true
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7")) {
            if (functions.GEN_INLIST(MCODE1, "0"))
                return true
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01369; TAG: N0482; NAME: Summary Stage 1977, TNM N (NAACCR)
    public boolean naaccr01369(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] NCODE = new char[5]
        char[] NCODE1 = new char[2]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmN, "1"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage1977) > 4)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            functions.GEN_STRCPY(NCODE, untrimmedline.tnmPathN)
            if (functions.GEN_INLIST(NCODE, "88,X")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88,X"))
                        functions.GEN_STRCPY(NCODE, untrimmedline.tnmClinN)
                }
            }
        }
        else
            functions.GEN_STRCPY(NCODE, untrimmedline.tnmClinN)
        functions.GEN_STRCPY(NCODE1, NCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0,1,2")) {
            if (functions.GEN_INLIST(NCODE1, "1-3"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4")) {
            if (functions.GEN_INLIST(NCODE1, "0"))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01370; TAG: N0230; NAME: Summary Stage 1977, TNM Stage Group (COC)
    public boolean naaccr01370(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))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977) && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
            return false
        return true

    }

    // ID: NAACCR-01371; TAG: N0530; NAME: Summary Stage 1977, Type of Report Source (NAACCR)
    public boolean naaccr01371(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01372; TAG: N0438; NAME: Summary Stage 2000 (NAACCR)
    public boolean naaccr01372(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        return functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0-5,7-9")

    }

    // ID: NAACCR-01373; TAG: N0501; NAME: Summary Stage 2000, Date DX, Date 1st Cont (NAACCR)
    public boolean naaccr01373(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, fc_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year >= 2018)
            return true
        if (dx_year != ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (dx_year > 2000 && dx_year < 2004) {
                if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                    return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis > 2000 and < 2004, then SEER Summary Stage 2000 cannot be blank')
                else
                    return true
            }
            if (dx_year > 2014) {
                if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                    return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is blank and year of Date of 1st Contact = 2015 or later, then SEER Summary Stage 2000 cannot be blank')
                else
                    return true
            }
            else
                return true
        }
        fc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (fc_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (fc_year >= 2018)
            return true
        if (fc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
        if (fc_year > 2000 && fc_year < 2004) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is blank and year of Date of 1st Contact > 2000 and < 2004, then SEER Summary Stage 2000 cannot be blank')
            else
                return true
        }
        if (fc_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is blank and year of Date of 1st Contact = 2015 or later, then SEER Summary Stage 2000 cannot be blank')
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01374; TAG: N0437; NAME: Summary Stage 2000, Date of Diagnosis (NAACCR)
    public boolean naaccr01374(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 > 2000 && dx_year < 2004) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        if (dx_year > 2014 && dx_year < 2018) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis = ${untrimmedline.dateOfDiagnosis.formatDate()} then SEER Summary Stage 2000 cannot 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-01375; TAG: N0440; NAME: Summary Stage 2000, EOD--LN Involv, ICDO3 (NAACCR)
    public boolean naaccr01375(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) || functions.GEN_EMPTY(untrimmedline.eodLymphNodeInvolv))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,2")) {
            if (functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "1-8"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "3,4")) {
            if (functions.GEN_INLIST(untrimmedline.eodLymphNodeInvolv, "0"))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01376; TAG: N1594; NAME: Summary Stage 2000, Over-ride CS 20 (NPCR)
    public boolean naaccr01376(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1")) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        return true

    }

    // ID: NAACCR-01377; TAG: N0441; NAME: Summary Stage 2000, Primary Site-Ed 5, ICDO3 (COC)
    public boolean naaccr01377(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001 || dx_year > 2003)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9731-9989")) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,300,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "691,699,700-701,709-719,720-725,728,729", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750-755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        return true

    }

    // ID: NAACCR-01378; TAG: N0579; NAME: Summary Stage 2000, Primary Site-Ed 6, ICDO3 (COC)
    public boolean naaccr01378(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year != 2003)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9731-9989")) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "103,173,254,260,268,269,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "681,688,689,691,699,701,709,710,", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750,754,755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
                return false
        }
        return true

    }

    // ID: NAACCR-01379; TAG: N0483; NAME: Summary Stage 2000, Regional Nodes Pos (NAACCR)
    public boolean naaccr01379(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsNodespos, "1"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage2000) > 4)
            return true
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,2")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "3,4")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00"))
                return false
            else {
                if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "99"))
                    return true
                else
                    return true
            }
        }
        return true

    }

    // ID: NAACCR-01380; TAG: N0485; NAME: Summary Stage 2000, TNM M (NAACCR)
    public boolean naaccr01380(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] MCODE = new char[5]
        char[] MCODE1 = new char[2]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM) && functions.GEN_EMPTY(untrimmedline.tnmClinM))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmM, "1"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathM)) {
            functions.GEN_STRCPY(MCODE, untrimmedline.tnmPathM)
            if (functions.GEN_INLIST(MCODE, "88,X")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88,X"))
                        functions.GEN_STRCPY(MCODE, untrimmedline.tnmClinM)
                }
            }
        }
        else
            functions.GEN_STRCPY(MCODE, untrimmedline.tnmClinM)
        functions.GEN_STRCPY(MCODE1, MCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,3,9")) {
            if (functions.GEN_INLIST(MCODE1, "1"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "2,4,5")) {
            if (functions.GEN_INLIST(MCODE1, "1"))
                return true
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "7")) {
            if (functions.GEN_INLIST(MCODE1, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "000,011,021,079,099,119,180-189,199,250-259,340-349,384,541,569,570,670-680", "(C\\d\\d\\d)", 2, 3))
                    return true
                else
                    return true
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01381; TAG: N0486; NAME: Summary Stage 2000, TNM N (NAACCR)
    public boolean naaccr01381(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] NCODE = new char[5]
        char[] NCODE1 = new char[2]
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN) && functions.GEN_EMPTY(untrimmedline.tnmClinN))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSsTnmN, "1"))
            return true
        if (functions.GEN_VAL(untrimmedline.seerSummaryStage2000) > 4)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathN)) {
            functions.GEN_STRCPY(NCODE, untrimmedline.tnmPathN)
            if (functions.GEN_INLIST(NCODE, "88,X")) {
                if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
                    if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88,X"))
                        functions.GEN_STRCPY(NCODE, untrimmedline.tnmClinN)
                }
            }
        }
        else
            functions.GEN_STRCPY(NCODE, untrimmedline.tnmClinN)
        functions.GEN_STRCPY(NCODE1, NCODE, 1)
        
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0,1,2")) {
            if (functions.GEN_INLIST(NCODE1, "1-3"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "3,4")) {
            if (functions.GEN_INLIST(NCODE1, "0"))
                return false
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01382; TAG: N0442; NAME: Summary Stage 2000, TNM Stage Group (COC)
    public boolean naaccr01382(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001 || dx_year > 2003)
            return true
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000) && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
            return false
        return true

    }

    // ID: NAACCR-01383; TAG: N0634; NAME: Surgery 98-02, Rad, Rad Surg (SEER IF105)
    public boolean naaccr01383(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        boolean result
        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 < 1998 || dx_year > 2002)
            return true
        if (functions.GEN_AT(untrimmedline.registryId, "0000001562") != 0 || functions.GEN_AT(untrimmedline.registryId, "0000001563") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "1-8")) || (functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "1-8"))) && (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-6,9"))
                result = true
            else
                result = false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && (functions.GEN_VAL(untrimmedline.rxSummScopeReg9802) == 0) && (functions.GEN_VAL(untrimmedline.rxSummSurgOth9802) == 0)) || (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0,7,8"))) {
                if (functions.GEN_VAL(untrimmedline.rxSummSurgRadSeq) == 0)
                    result = true
                else
                    result = false
            }
            else
                result = true
        }
        return result

    }

    // ID: NAACCR-01384; TAG: N0636; NAME: Surgery 98-02, Reason for No Surg (SEER IF107)
    public boolean naaccr01384(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgSite9802) || functions.GEN_EMPTY(untrimmedline.rxSummScopeReg9802) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOth9802) || functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "1-8") || functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "1-8")) {
            if (functions.GEN_STRCMP(untrimmedline.reasonForNoSurgery, "0") != 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00") && (functions.GEN_VAL(untrimmedline.rxSummScopeReg9802) == 0) && (functions.GEN_VAL(untrimmedline.rxSummSurgOth9802) == 0)) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,2,6-8"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgSite9802, "00,99") && functions.GEN_INLIST(untrimmedline.rxSummScopeReg9802, "0,9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOth9802, "0,9")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                return false
        }
        return true

    }

    // ID: NAACCR-01385; TAG: N0429; NAME: Surgery, Rad, Surg/Rad Seq (SEER IF75)
    public boolean naaccr01385(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")) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year > 2011) || (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5"))) && (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1-6"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year > 2011))) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || (functions.GEN_INLIST(untrimmedline.rxSummRadiation, "0"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-01386; TAG: N0425; NAME: Surgery, RX Date Surgery, ICDO2 (COC)
    public boolean naaccr01386(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))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            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) || functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9650-9698,9702-9717") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9720,9760-9764,9800-9820,9826,9840-9894,9910,9931-9962,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,809", "(C\\d\\d\\d)", 2, 3))
            exception = 1
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-8") || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-8")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return false
            else
                return true
        }
        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.rxSummSurgOthRegDis, "0")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "11"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01387; TAG: N1606; NAME: Surgery, RX Date Surgery, ICDO3 (COC)
    public boolean naaccr01387(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))
            return true
        if (dx_year == 2018 && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9702-9992"))
            return true
        if (dx_year > 2018)
            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) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (dx_year < 2010) {
            if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3))
                exception = 1
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,760-768,809", "(C\\d\\d\\d)", 2, 3))
                exception = 1
        }
        if (dx_year == 2018) {
            if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9726,9728-9732,9734-9740,9750-9762,9811-9831,9940,9948,9971") && functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727,9733,9741-9742,9764-9809,9832,9840-9931,9945-9946,9950-9967,9975-9992") || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,761-768,809", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "C760") && functions.GEN_INLIST(untrimmedline.schemaId, "99999")))
                exception = 1
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year >= 2012 && dx_year <= 2017) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") && dx_year == 2018) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year > 2011) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If surgery performed and RX Date Surgery is blank,if year of Date of Diagnosis < 2012, RX Date Surgery Flag must = 10 or 12')
                }
                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, if year of Date of Diagnosis > 2011, 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, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year >= 2012 && dx_year <= 2017))) && 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-01388; TAG: N0423; NAME: Surgery, Rad, Surg/Rad Seq (COC)
    public boolean naaccr01388(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int result, surg_num, scope_num, surgoth_num
        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))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) || functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        if (((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) || ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year >= 2012 && dx_year <= 2017) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") && dx_year >= 2018) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year >= 2012 && dx_year <= 2018) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && dx_year >= 2021)) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) && (functions.GEN_AT(untrimmedline.reasonForNoRadiation, "0") != 0)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99") && dx_year >= 2012 && dx_year <= 2018) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1") && dx_year >= 2021)) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "1,2,5-7")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else {
                if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "1,2,5-7")) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01389; TAG: N0424; NAME: Surgery, Reason No Surg (COC)
    public boolean naaccr01389(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                return false
        }
        return true

    }

    // ID: NAACCR-01390; TAG: N0430; NAME: Surgery, Reason for No Surg (SEER IF77)
    public boolean naaccr01390(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98")) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,2,5-8"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90")) {
            if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
            if (functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0"))
                return false
        }
        return true

    }

    // ID: NAACCR-01391; TAG: N0759; NAME: Systemic RX, Surgery, Systemic/Sur Seq (COC)
    public boolean naaccr01391(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || 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.rxSummSystemicSurSeq))
            return true
        if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90", "(\\d\\d)") || ((functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1-7") && dx_year < 2012) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1,3-7") && dx_year >= 2012 && dx_year <= 2017) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") && dx_year >= 2018) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98", "(\\d\\d)") && dx_year > 2011 && dx_year <= 2020) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && dx_year >= 2021)) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) && (functions.GEN_INLIST(untrimmedline.rxSummBrm, "01", "(\\d\\d)") || functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03", "(\\d\\d)") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "01", "(\\d\\d)") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-40", "(\\d\\d)"))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "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, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00,99", "(\\d\\d)") && dx_year >= 2012 && dx_year <= 2017) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1") && dx_year >= 2021)) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82-88", "(\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0"))
                    return true
                else
                    return false
            }
            else {
                if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "98") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82-88", "(\\d\\d)") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82-88", "(\\d\\d)"))) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01392; TAG: N0144; NAME: TNM Clin Descriptor (COC)
    public boolean naaccr01392(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor))
            return true
        return functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "0-3,5,9")

    }

    // ID: NAACCR-01393; TAG: N1907; NAME: TNM Clin Descriptor, Date of Diagnosis (NPCR)
    public boolean naaccr01393(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 < 2014 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinDescriptor))
            return true
        return functions.GEN_INLIST(untrimmedline.tnmClinDescriptor, "0-3,5,9")

    }

    // ID: NAACCR-01396; TAG: N0038; NAME: TNM Clin Stage Group (COC)
    public boolean naaccr01396(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 > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0-4", "(\\d\\s\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0A,0S,1A,A1,A2,1B,B1,B2,1C,1S,2A,2B,2C,3A,3B,3C,4A,4B,4C,88,99,OC", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "1E,1S,2E,2S,3E,3S,4E,4S", "([A-Za-z0-9][A-Za-z0-9]\\s\\s)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "0IS,1A1,1A2,1B1,1B2,2A1,2A2,3C1,3C2,4A1,4A2", "([A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]\\s)"))
            return true
        return false

    }

    // ID: NAACCR-01397; TAG: N0852; NAME: TNM Clin Stage Group, TNM Items, ICDO3 (COC)
    public boolean naaccr01397(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06") || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9667,9670-9729") || functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3)) {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") || functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
                    return functions.GEN_ERROR_MSG(binding, 'If TNM Clin Stage Group not = 88, then TNM Clin T and M must not = 88')
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88")) {
                if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") || functions.GEN_INLIST(untrimmedline.tnmClinM, "88") || functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-01398; TAG: N0243; NAME: TNM Clin Stage Group, TNM Path Stage Group (COC)
    public boolean naaccr01398(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 > 2017)
            return true
        if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) != 88 && !functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
                return false
        }
        if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) != 88)
                return false
        }
        return true

    }

    // ID: NAACCR-01399; TAG: N0931; NAME: TNM Clin Stage Group, TNM Path Stage Group (NAACCR)
    public boolean naaccr01399(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 > 2017)
            return true
        if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) != 88)
                return false
        }
        if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) != 88)
                return false
        }
        return true

    }

    // ID: NAACCR-01400; TAG: N0145; NAME: TNM Clin Staged By (COC)
    public boolean naaccr01400(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tnmClinStagedBy))
            return true
        return functions.GEN_INLIST(untrimmedline.tnmClinStagedBy, "00, 10, 11, 12, 13, 14, 15, 20, 30, 40, 50, 60, 88, 99")

    }

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

    }

    // ID: NAACCR-01403; TAG: N0623; NAME: TNM Edition Number, Date of Diagnosis (COC)
    public boolean naaccr01403(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002 && dx_year < 2010) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "000688", 2) == 0)
                return false
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "000788", 2) == 0)
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2010-2017, then TNM Edition Number must = 00, 07, or 88')
        }
        if (dx_year > 2017 && dx_year < 2021) {
            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')
        }
        if (dx_year > 2020) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "00080988", 2) == 0)
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2021+, then TNM Edition Number must = 00, 08, 09, or 88')
        }
        return true

    }

    // ID: NAACCR-01404; TAG: N1810; NAME: TNM Edition Number, Date of Diagnosis (NPCR)
    public boolean naaccr01404(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 < 2015 || dx_year > 2017)
            return true
        if (dx_year == 2015) {
        
            if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
                return true
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0788", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Edition Number must = 07 or 88')
            else
                return true
        }
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_AT(untrimmedline.typeOfReportingSource, "67", 1) == 0)) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0788", 2) == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01405; TAG: N0724; NAME: TNM Edition Number, No AJCC Ed 5 Scheme,ICDO3 (COC)
    public boolean naaccr01405(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001 || dx_year > 2002)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9731-9989")) {
            if (!(functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88")))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,300,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "691,699,700-701,709-719,720-725,728,729", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750-755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (!(functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88")))
                return false
        }
        return true

    }

    // ID: NAACCR-01406; TAG: N0723; NAME: TNM Edition Number, No AJCC Ed 6 Scheme,ICDO3 (COC)
    public boolean naaccr01406(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003 || dx_year > 2009)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9699,9702-9719,9727-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9731-9989")) {
            if (!(functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88")))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "681,688,689,691,699", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "700-729,740,741,749,750-755,758-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (!(functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88")))
                return false
        }
        return true

    }

    // ID: NAACCR-01407; TAG: N0725; NAME: TNM Edition, TNM Clin Stage, TNM Path Stage (COC)
    public boolean naaccr01407(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009)
            return true
        if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) != 88)
                return false
        }
        if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) != 88 && !functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "441,690,692,695,696,698", "(C\\d\\d\\d)", 2, 3))
            return true
        if (dx_year > 1995) {
            if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) == 88) {
                if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) == 88) {
                    if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) != 88)
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01408; TAG: N0930; NAME: TNM Edition, TNM Clin Stage, TNM Path Stg (NAACCR)
    public boolean naaccr01408(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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009)
            return true
        if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) != 88)
                return false
        }
        if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) == 88) {
            if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) != 88)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "441,690,692,695,696,698", "(C\\d\\d\\d)", 2, 3))
            return true
        if (dx_year > 1995) {
            if (functions.GEN_VAL(untrimmedline.tnmPathStageGroup) == 88) {
                if (functions.GEN_VAL(untrimmedline.tnmClinStageGroup) == 88) {
                    if (functions.GEN_VAL(untrimmedline.tnmEditionNumber) != 88)
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01409; TAG: N0143; NAME: TNM Path Descriptor (COC)
    public boolean naaccr01409(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor))
            return true
        return functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "0-6,9")

    }

    // ID: NAACCR-01410; TAG: N1809; NAME: TNM Path Descriptor, Date of Diagnosis (NPCR)
    public boolean naaccr01410(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 < 2014 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmPathDescriptor))
            return true
        return functions.GEN_INLIST(untrimmedline.tnmPathDescriptor, "0-6,9")

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy