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

com.imsweb.validation.edits.translated.ncfd.NcfdTranslatedCompiledRules.groovy Maven / Gradle / Ivy

There is a newer version: 023-01
Show newest version
package com.imsweb.validation.edits.translated.ncfd

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

@CompileStatic
class NcfdTranslatedCompiledRules implements CompiledRules {

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

    @Override
    public String getValidatorVersion() {
        return 'NCFD-014-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]
        ]
    }

    // ID: NCFD-00002; TAG: 1840; NAME: Addr at DX--Postal Code (Subm)
    public boolean ncfd00002(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxPostalCode))
            return true
        return functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")

    }

    // ID: NCFD-00003; TAG: N0122; NAME: Addr at DX--State (NAACCR)
    public boolean ncfd00003(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_LOOKUP(untrimmedline.addrAtDxState, context.NCFD_STATE, context.NCFD_STATE_CODE, [:])

    }

    // ID: NCFD-00004; TAG: N0026; NAME: Age at Diagnosis (SEER AGEDX)
    public boolean ncfd00004(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-120,999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00005; TAG: N0025; NAME: Age, Birth Date, Date of Diagnosis (NAACCR IF13)
    public boolean ncfd00005(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int wrk_age, diag_age
        int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
        
        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000")) {
            if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "2,3"))
                return true
        }
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
        
        if (birth_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
        diag_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        
        if (diag_age == 999) {
            if ((dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.NCFD_GEN_DT_EMPTY)))
                return true
            else
                return false
        }
        if ((dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY)) || (birth_year == ((Integer)context.NCFD_GEN_DT_EMPTY))) {
            if (diag_age == 999)
                return true
            else
                return false
        }
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
        
        if ((birth_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY)))
            wrk_age = dx_year - birth_year
        else
            wrk_age = (int)(((dx_year * 12 + dx_month) - (birth_year * 12 + birth_month)) / 12)
        if ((birth_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY))) {
            if (diag_age == wrk_age || diag_age == (wrk_age - 1))
                return true
            else
                return false
        }
        dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
        birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
        
        if (dx_month == birth_month) {
            if ((dx_day == ((Integer)context.NCFD_GEN_DT_DAY_EMPTY)) || (birth_day == ((Integer)context.NCFD_GEN_DT_DAY_EMPTY))) {
                if (diag_age == wrk_age || diag_age == (wrk_age - 1))
                    return true
                else
                    return false
            }
            else {
                if (dx_day < birth_day)
                    wrk_age = (wrk_age - 1)
            }
        }
        if (diag_age == wrk_age)
            return true
        else
            return false
        
        return true

    }

    // ID: NCFD-00007; TAG: N0718; NAME: Age, Primary Site, Morph ICDO3--Adult (SEER)
    public boolean ncfd00007(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int agetemp
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        
        if (agetemp < 15)
            return true
        if (agetemp < 20) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209-218,239,240-249,250-259,384,500-509,559,540-549", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(\\d\\d\\d\\d3)")))
                return false
        }
        if (agetemp < 30) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9732, 9823, 9863, 9875, 9876, 9945", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp < 40) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8140", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 5) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9510-9514", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 14) {
            if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8960,9946", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 45) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        return true

    }

    // ID: NCFD-00008; TAG: N0717; NAME: Age, Primary Site, Morph ICDO3--Pediatric (NPCR)
    public boolean ncfd00008(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int agetemp
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001)
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        
        if (agetemp > 14) {
            return true
        }
        if (agetemp < 3) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650-9667"))
                return false
        }
        if (agetemp > 9 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9490,9500"))
                return false
        }
        if (agetemp > 5 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514"))
                return false
        }
        if (agetemp > 8 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960,8964"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8963") && functions.GEN_INLIST(untrimmedline.primarySite, "649,809", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 9) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8221-8231,8240,8241,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8401,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "649", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8312"))
                return false
        }
        if (agetemp > 5 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8970"))
                return false
        }
        if (agetemp < 9) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8140,8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8230,8231,8240,8241,8244-8246,8260-8263,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8401,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "220,221", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8160-8180"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9180-9200"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9220-9230"))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9231,9240") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 4) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9260") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419,809", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9363,9364") && functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp > 7 && agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9060-9102") && functions.GEN_INLIST(untrimmedline.primarySite, "000-559,570-619,630-699,739-750,754-809", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8143,8155,8190-8201") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8211,8221-8241,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480-8490,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "569,620-629", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8380,8381,8441-8473"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8155,8190,8200,8201") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8211,8230,8231,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480,8481,8500-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8330-8350"))
                return false
        }
        if (agetemp < 6) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8120-8122,8130-8141,8155,8190,8200,8201") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8211,8230,8231,8244-8246,8260-8263,8290,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8430,8440,8480,8481,8504,8510,8550,8560-8573") && functions.GEN_INLIST(untrimmedline.primarySite, "110-119", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 5) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8041,8050-8075,8082,8090-8110,8140,8143,8147,8190,8200") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8240,8246,8247,8260,8310,8320") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8323,8390-8420,8430,8480,8542,8560,8570-8573,8940") && functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 5) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8082,8120-8155,8190-8263,8290,8310,8314-8323") && functions.GEN_INLIST(untrimmedline.primarySite, "000-109,129-218,239-399,480-488,500-559,570-619,630-639,659-729,750-809", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8430-8440,8480-8580,8940,8941") && functions.GEN_INLIST(untrimmedline.primarySite, "000-109,129-218,239-399,480-488,500-559,570-619,630-639,659-729,750-809", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9053"))
                return false
        }
        if (agetemp < 15) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9100") && functions.GEN_INLIST(untrimmedline.primarySite, "589", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209,210-218,239", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "240-249,250-259,384,500-509,559,540-549,609", "(C\\d\\d\\d)", 2, 3))
                return false
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8240-8245") && functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8140") && functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3))
                return false
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732,9823,9863,9875,9876,9945"))
                return false
        }
        return true

    }

    // ID: NCFD-00009; TAG: N0449; NAME: Age, Primary Site, Morphology ICDO3 (SEER IF15)
    public boolean ncfd00009(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int agetemp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3))
            return true /* don't test further if age is unknown */
        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        
        if (agetemp < 15) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(\\d\\d\\d\\d2)")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(9100\\d)")))
                return false
        }
        if (agetemp < 20) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209-218,239,240-249,250-259,384,500-509,559,540-549", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "00000-82399,82460-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO3, "(\\d\\d\\d\\d3)")))
                return false
        }
        if (agetemp < 30) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9732, 9823, 9863, 9875, 9876, 9945", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp < 40) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8140", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 5) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9510-9514", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 14) {
            if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "8960,9946", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 45) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        return true

    }

    // ID: NCFD-00011; TAG: N0653; NAME: Behavior Code ICDO3, Seq Num--Central (SEER IF114)
    public boolean ncfd00011(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.behaviorCodeIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,99", "(\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1"))
                    return true
            }
        }
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
                if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,98,99", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
                return true
            else
                return false
        }
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
                if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00012; TAG: N0837; NAME: Behavior ICDO3 Conversion (NAACCR)
    public boolean ncfd00012(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0-3")

    }

    // ID: NCFD-00013; TAG: N0654; NAME: Behavior ICDO3, Site, Histology ICDO3 (NAACCR)
    public boolean ncfd00013(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.behaviorCodeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
            if (dx_year > 2003 && functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1")) {
            if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473"))
                return true
        }
        return false

    }

    // ID: NCFD-00014; TAG: N0838; NAME: Behavior ICDO3, Summary Stage 1977 (NAACCR)
    public boolean ncfd00014(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"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00015; TAG: N0439; NAME: Behavior ICDO3, Summary Stage 2000 (NAACCR)
    public boolean ncfd00015(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
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00016; TAG: N1688; NAME: Birthplace--Country (COC)
    public boolean ncfd00016(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.birthplaceCountry, context.NCFD_CNTRY_ST, context.NCFD_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NCFD-00018; TAG: N1672; NAME: Birthplace--Country, Birthplace--State (NAACCR)
    public boolean ncfd00018(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cntry_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry) || functions.GEN_EMPTY(untrimmedline.birthplaceState))
            return true
        if (functions.GEN_INLIST(untrimmedline.birthplaceState, "XX") && functions.GEN_INLIST(untrimmedline.birthplaceCountry, "ZZX"))
            return false
        functions.GEN_STRCPY(cntry_state, untrimmedline.birthplaceCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.birthplaceState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.NCFD_CNTRY_ST, context.NCFD_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

    // ID: NCFD-00019; TAG: N1694; NAME: Birthplace--State (COC)
    public boolean ncfd00019(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.birthplaceState))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.birthplaceState, context.NCFD_CNTRY_ST, context.NCFD_CNTRY_ST_STATE, [:]))
            return false
        
        return true

    }

    // ID: NCFD-00020; TAG: N1693; NAME: Birthplace--State, Date of Diagnosis (NAACCR)
    public boolean ncfd00020(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.birthplaceState))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.birthplaceState, "NN,MM,PP,XN"))
                return false
        }
        
        return true

    }

    // ID: NCFD-00021; TAG: N0908; NAME: CS Eval Items, Type of Reporting Source (CS)
    public boolean ncfd00021(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "8") || functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "8") || functions.GEN_INLIST(untrimmedline.csMetsEval, "8")) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6"))
                return false
        }
        return true

    }

    // ID: NCFD-00022; TAG: N0906; NAME: CS Eval Items, Vital Status (CS)
    public boolean ncfd00022(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.vitalStatus))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "8") || functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "8") || functions.GEN_INLIST(untrimmedline.csMetsEval, "8")) {
            if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                    return false
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2")) {
                if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00026; TAG: N0656; NAME: CS Extension (CS)
    public boolean ncfd00026(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        return functions.GEN_INLIST(untrimmedline.csExtension, "000-999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00042; TAG: N1116; NAME: CS Extension, Schema (CS)
    public boolean ncfd00042(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csExtension)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 2, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00052; TAG: N0657; NAME: CS Lymph Nodes (CS)
    public boolean ncfd00052(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        return functions.GEN_INLIST(untrimmedline.csLymphNodes, "000-999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00053; TAG: N0660; NAME: CS Lymph Nodes Eval (CS)
    public boolean ncfd00053(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval))
            return true
        return functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0-3,5,6,8,9")

    }

    // ID: NCFD-00055; TAG: N1175; NAME: CS Lymph Nodes Eval, Schema (CS)
    public boolean ncfd00055(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csLymphNodesEval)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 5, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00060; TAG: N1163; NAME: CS Lymph Nodes, Schema (CS)
    public boolean ncfd00060(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csLymphNodes)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 4, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00061; TAG: N0661; NAME: CS Mets Eval (CS)
    public boolean ncfd00061(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsEval))
            return true
        return functions.GEN_INLIST(untrimmedline.csMetsEval, "0-3,5,6,8,9")

    }

    // ID: NCFD-00063; TAG: N1176; NAME: CS Mets Eval, Schema (CS)
    public boolean ncfd00063(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsEval) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csMetsEval)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 9, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00064; TAG: N0658; NAME: CS Mets at DX (CS)
    public boolean ncfd00064(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        return functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00-99", "(\\d\\d)")

    }

    // ID: NCFD-00066; TAG: N1164; NAME: CS Mets at DX, Schema (CS)
    public boolean ncfd00066(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] cs_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(cs_code, untrimmedline.csMetsAtDx)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 8, 1, cs_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00069; TAG: 1816; NAME: CS Over-rides (Subm)
    public boolean ncfd00069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.overRideCs20) || functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))
            return true
        else
            return functions.GEN_SAVE_ERROR_TEXT(binding, 'Over-ride CS 20 must be blank or = 1')
        
        return true

    }

    // ID: NCFD-00072; TAG: N0662; NAME: CS Site-Specific Factor 1 (CS)
    public boolean ncfd00072(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor1, "(\\d\\d\\d)")

    }

    // ID: NCFD-00074; TAG: N0663; NAME: CS Site-Specific Factor 2 (CS)
    public boolean ncfd00074(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor2, "(\\d\\d\\d)")

    }

    // ID: NCFD-00078; TAG: N1003; NAME: CS Site-Specific Factor15 (CS)
    public boolean ncfd00078(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor15, "(\\d\\d\\d)")

    }

    // ID: NCFD-00080; TAG: N1013; NAME: CS Site-Specific Factor25 (CS)
    public boolean ncfd00080(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor25, "(\\d\\d\\d)")

    }

    // ID: NCFD-00081; TAG: N1387; NAME: CS Site-Specific Factor25, Schema (CS)
    public boolean ncfd00081(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor25)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 34, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25 [${untrimmedline.csSiteSpecificFactor25}] must be 981 for this site (${untrimmedline.primarySite}) within this schema')
        
        if (functions.GEN_INLIST(t_schema_name, "EsophagusGEJunction,Nasopharynx,Stomach")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "110,112,113,118,119,163-169", "(C\\d\\d\\d)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "981")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25 [${untrimmedline.csSiteSpecificFactor25}] must be 982 for this site (${untrimmedline.primarySite}) within this schema') /*
        The following sites within EsophagusGEJunction and 
        Stomach schemas should have a SSF 25 of 982s. (SSF 25 of spaces are 
        skipped at beginning of edit).
        */
        if (functions.GEN_INLIST(t_schema_name, "EsophagusGEJunction,Nasopharynx,Stomach")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "160", "(C\\d\\d\\d)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "982")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25 [${untrimmedline.csSiteSpecificFactor25}] must be 981 for site (${untrimmedline.primarySite})/histology (${untrimmedline.histologicTypeIcdO3}) within this schema')
        
        if (functions.GEN_INLIST(t_schema_name, "Peritoneum") && functions.GEN_INLIST(untrimmedline.primarySite, "481,482,488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8580-8589,8680-8921,9120-9136,9141-9582,9700-9701")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "981")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        
        return true

    }

    // ID: NCFD-00084; TAG: N0655; NAME: CS Tumor Size (CS)
    public boolean ncfd00084(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSize))
            return true
        return functions.GEN_MATCH(untrimmedline.csTumorSize, "(\\d\\d\\d)")

    }

    // ID: NCFD-00085; TAG: N1178; NAME: CS Tumor Size, Schema (CS)
    public boolean ncfd00085(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSize) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csTumorSize)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 1, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00087; TAG: N0659; NAME: CS Tumor Size/Ext Eval (CS)
    public boolean ncfd00087(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval))
            return true
        return functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "0-6,8,9")

    }

    // ID: NCFD-00088; TAG: N1177; NAME: CS Tumor Size/Ext Eval, Schema (CS)
    public boolean ncfd00088(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csTumorSizeExtEval)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 3, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00100; TAG: N0309; NAME: Census Tr Cert 1970/80/90 (SEER CENSCERT)
    public boolean ncfd00100(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTrCert19708090))
            return true
        return functions.GEN_INLIST(untrimmedline.censusTrCert19708090, "1-6, 9")

    }

    // ID: NCFD-00101; TAG: N0540; NAME: Census Tr Certainty 2000 (SEER)
    public boolean ncfd00101(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTrCertainty2000))
            return true
        return functions.GEN_INLIST(untrimmedline.censusTrCertainty2000, "1-6, 9")

    }

    // ID: NCFD-00102; TAG: N1374; NAME: Census Tr Certainty 2010 (SEER)
    public boolean ncfd00102(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTrCertainty2010))
            return true
        return functions.GEN_INLIST(untrimmedline.censusTrCertainty2010, "1-6, 9")

    }

    // ID: NCFD-00109; TAG: N0651; NAME: County at DX Reported (Subm)
    public boolean ncfd00109(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.countyAtDx, "998"))
            return false
        return functions.GEN_MATCH(untrimmedline.countyAtDx, "(\\d\\d\\d)")

    }

    // ID: NCFD-00110; TAG: 1799; NAME: County at DX, Addr at DX--State (Subm)
    public boolean ncfd00110(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cnty_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDx) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.countyAtDx, "000"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "CD,US,XX,YY,ZZ"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AA,AE,AP"))
            return true
        functions.GEN_STRCPY(cnty_state, untrimmedline.countyAtDx)
        functions.GEN_STRCAT(cnty_state, untrimmedline.addrAtDxState)
        
        if (functions.GEN_LOOKUP(cnty_state, context.NCFD_CNTYALL, context.NCFD_CNTYALL_CNTYSTAT, [:]))
            return true
        return false

    }

    // ID: NCFD-00121; TAG: N1034; NAME: Date of Birth (NAACCR)
    public boolean ncfd00121(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfBirth))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfBirth))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00124; TAG: N1048; NAME: Date of Birth, Date of Diagnosis (NAACCR IF47)
    public boolean ncfd00124(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int months_diff, err_flag, dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfBirth) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfBirth, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfBirth))
                functions.GEN_ERROR_TEXT(binding, 'Date of Birth is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis is invalid: %DC')
            }
            return false
        }
        if (dtcmp <= 0)
            return true
        err_flag = 1
        
        // *** START function call Check_InUtero()
        int dx_year_1, birth_year_1
        
        dx_year_1 = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        birth_year_1 = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
        
        if (dx_year_1 >= birth_year_1)
            months_diff = functions.GEN_MONTHDIFF_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfBirth, ((Integer)context.NCFD_GEN_DT_MIN))
        else
            months_diff = functions.GEN_MONTHDIFF_IOP(binding, untrimmedline.dateOfBirth, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        if (months_diff <= 7) {
            if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "2,3"))
                err_flag = 0
            else
                functions.GEN_ERROR_TEXT(binding, 'Please Review: Set over-ride to 2 or 3 if case diagnosed in utero')
        }
        else
            functions.GEN_ERROR_TEXT(binding, 'Please Review: Date of Birth cannot be more than 7 months after Diagnosis')
        null// *** END function call Check_InUtero()
        
        
        if (err_flag == 1)
            return false
        
        return true

    }

    // ID: NCFD-00125; TAG: N0021; NAME: Date of Diagnosis (NAACCR DATEEDIT)
    public boolean ncfd00125(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00128; TAG: N0022; NAME: Date of Last Contact (NAACCR DATEEDIT)
    public boolean ncfd00128(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00131; TAG: N0024; NAME: Date of Last Contact, Date of Diag (NAACCR IF19)
    public boolean ncfd00131(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year, dx_month, dx_day, last_year, last_month, last_day
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_EXACT))
        
        if (dtcmp <= 0)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
        last_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        last_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfLastContact)
        last_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (dx_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY) || last_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY)) {
            if (dx_year <= last_year)
                return true
            else
                return false
        }
        else {
            if (dx_day == ((Integer)context.NCFD_GEN_DT_DAY_EMPTY) || last_day == ((Integer)context.NCFD_GEN_DT_DAY_EMPTY)) {
                if (dx_year < last_year)
                    return true
                else {
                    if (dx_year == last_year && dx_month <= last_month)
                        return true
                    else
                        return false
                }
            }
            else
                return false
        }
        return false

    }

    // ID: NCFD-00137; TAG: N0673; NAME: Derived SS2000 (CS)
    public boolean ncfd00137(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs2000))
            return true
        if (functions.GEN_INLIST(untrimmedline.derivedSs2000, "0-5, 7-9"))
            return true
        return false

    }

    // ID: NCFD-00139; TAG: N0217; NAME: Diagnostic Confirm, Seq Num--Central (SEER IF23)
    public boolean ncfd00139(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.overRideSeqnoDxconf, "1") || functions.GEN_INLIST(untrimmedline.primarySite, "760-768, 809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-99"))
            return true
        if (functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6-9") && !functions.GEN_MATCH(untrimmedline.sequenceNumberCentral, "(00)"))
            return false
        return true

    }

    // ID: NCFD-00140; TAG: N0003; NAME: Diagnostic Confirmation (SEER DXCONF)
    public boolean ncfd00140(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1-9")

    }

    // ID: NCFD-00141; TAG: N0471; NAME: Diagnostic Confirmation, Behavior ICDO3 (SEER IF31)
    public boolean ncfd00141(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideHistology, "(2)|(3)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.behaviorCodeIcdO3, "(2)")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,2,4"))
                return false
        }
        return true

    }

    // ID: NCFD-00142; TAG: N0444; NAME: Diagnostic Confirmation, Histology ICDO3 (SEER IF48)
    public boolean ncfd00142(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideLeukLymphoma, "1"))
            return true
        if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993", "(\\d\\d\\d\\d)") && functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "6")))
            return false
        if (functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "3")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993"))
                return false
        }
        return true

    }

    // ID: NCFD-00144; TAG: N0027; NAME: Edit Over-rides (SEER REVIEWFL)
    public boolean ncfd00144(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideHistology, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideAgeSiteMorph, "([1-3])|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSeqnoDxconf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatSeqno, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSurgDxconf, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideReportSource, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideIllDefineSite, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideLeukLymphoma, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteEodDxDt, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatEod, "(1)|(\\s)") && functions.GEN_MATCH(untrimmedline.overRideSiteLatMorph, "(1)|(\\s)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NCFD-00146; TAG: N1030; NAME: Follow-Up Source Central, Vital Status (NPCR)
    public boolean ncfd00146(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpSourceCentral) || functions.GEN_EMPTY(untrimmedline.vitalStatus))
            return true
        if (functions.GEN_INLIST(untrimmedline.followUpSourceCentral, "04, 05, 06, 07, 64", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1"))
                return false
        }
        return true

    }

    // ID: NCFD-00147; TAG: N0372; NAME: Follow-Up Source, Vital Status (COC)
    public boolean ncfd00147(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpSource) || functions.GEN_EMPTY(untrimmedline.vitalStatus))
            return true
        if (functions.GEN_INLIST(untrimmedline.followUpSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1"))
                return false
        }
        return true

    }

    // ID: NCFD-00148; TAG: N0750; NAME: Follow-up Source Central (NAACCR)
    public boolean ncfd00148(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.followUpSourceCentral))
            return true
        return functions.GEN_INLIST(untrimmedline.followUpSourceCentral, "00-12,29-35,39-43,48-51,59-65,98,99", "(\\d\\d)")

    }

    // ID: NCFD-00149; TAG: N0751; NAME: Follow-up Source Central, Date of DX (NPCR)
    public boolean ncfd00149(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2005) {
            if (functions.GEN_EMPTY(untrimmedline.followUpSourceCentral))
                return false
        }
        return true

    }

    // ID: NCFD-00153; TAG: N0839; NAME: Hemato ICDO3, Summ Stg 1977 (NAACCR)
    public boolean ncfd00153(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"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731-9989"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731,9734,9740,9750-9752,9755-9758,9764,9930")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1,7,9"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 1, 7, or 9 for this histology')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "7"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'SEER Summary Stage must = 7 for this histology')
        }
        return true

    }

    // ID: NCFD-00154; TAG: N1784; NAME: Histologic Type ICD-O-3, Behavior, Grade (SEER)
    public boolean ncfd00154(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3) || functions.GEN_EMPTY(untrimmedline.grade))
            return true
        if (functions.GEN_INLIST(untrimmedline.grade, "5,6,7,8")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9992"))
                return functions.GEN_ERROR_MSG(binding, 'Grades 5-8 allowed only for histologies 9590-9992')
        }
        if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8331,9511")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "1"))
                return functions.GEN_ERROR_MSG(binding, 'This histology (${untrimmedline.histologicTypeIcdO3}) carries an implied grade of 1')
            else
                return true
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8020,8021,9082,9083")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "C809") && functions.GEN_INLIST(untrimmedline.grade, "9"))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9083")) {
                        if (!functions.GEN_INLIST(untrimmedline.grade, "2"))
                            return functions.GEN_ERROR_MSG(binding, 'This histology (${untrimmedline.histologicTypeIcdO3}) carries an implied grade of 2')
                        else
                            return true
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8020,8021,9082")) {
                            if (!functions.GEN_INLIST(untrimmedline.grade, "4"))
                                return functions.GEN_ERROR_MSG(binding, 'This histology (${untrimmedline.histologicTypeIcdO3}) carries an implied grade of 4')
                            else
                                return true
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9401,9451,9512")) {
                                if (!functions.GEN_INLIST(untrimmedline.grade, "4"))
                                    return functions.GEN_ERROR_MSG(binding, 'This histology (${untrimmedline.histologicTypeIcdO3}) carries an implied grade of 4')
                                else
                                    return true
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NCFD-00155; TAG: N0840; NAME: Histologic Type ICDO3 Conversion (NAACCR)
    public boolean ncfd00155(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_HISICDO3, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_HISICDO3_HISTOLOGY, untrimmedline.histologicTypeIcdO3, [:]))
            return false
        return true

    }

    // ID: NCFD-00156; TAG: N1965; NAME: Histology ICDO3, Grade, Date of DX (SEER)
    public boolean ncfd00156(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.NCFD_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR)))
            return true
        if (dx_year < 2010 || dx_year > 2017)
            return true
        if ((functions.GEN_EMPTY(untrimmedline.grade)) || (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9700-9702,9705,9708,9709,9716-9718,9724-9726")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "5"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 5 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9714")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "5,6"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 5 or 6 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9827,9834,9837")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "5"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 5 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9591,9596,9597,9659,9671,9673,9678-9680,9687-9691")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "6"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 6 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9695,9698,9699,9712,9731,9732,9734,9737,9738,9761,9762,9811-9818")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "6"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 6 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9823,9826,9833,9940")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "6"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 6 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9719,9948")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "8"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 8 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740-9742,9751,9755-9759,9801,9806-9809,9875,9876,9945,9946")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "9"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 9 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9950,9961-9964,9975,9980,9982,9983,9985,9986,9989,9991,9992")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "9"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 9 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9831")) {
            if (!functions.GEN_INLIST(untrimmedline.grade, "5,8,9"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must be 5, 8, or 9 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590,9650,9651,9652,9653,9655,9663,9727,9735,9800,9820,9832")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "1-4"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must not = 1-4 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9840,9860,9861,9863,9865-9867,9869,9870-9874,9891,9895-9898,9910,9911")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "1-4"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must not = 1-4 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9920,9930,9931,9965,9966,9967,9971")) {
            if (functions.GEN_INLIST(untrimmedline.grade, "1-4"))
                return functions.GEN_ERROR_MSG(binding, 'Grade [${untrimmedline.grade}] must not = 1-4 when Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}')
        }
        
        return true

    }

    // ID: NCFD-00159; TAG: N0713; NAME: ICD Revision, Vital Stat, Date Last Contact (NPCR)
    public boolean ncfd00159(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dolc_year
        
        if (functions.GEN_EMPTY(untrimmedline.causeOfDeath))
            functions.GEN_NOOP()
        if (functions.GEN_EMPTY(untrimmedline.icdRevisionNumber))
            return true
        dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (dolc_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dolc_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0")) {
            if (dolc_year > 1978 && dolc_year < 1999) {
                if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0,1"))
                    return true
                else
                    return false
            }
            else {
                if (dolc_year == 1999) {
                    if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9,1"))
                        return true
                    else
                        return false
                }
                else {
                    if (dolc_year > 1999) {
                        if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "1"))
                            return true
                        else
                            return false
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
            if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                return false
        }
        return true

    }

    // ID: NCFD-00160; TAG: N0753; NAME: IHS Link (NPCR)
    public boolean ncfd00160(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ihsLink))
            return true
        return functions.GEN_INLIST(untrimmedline.ihsLink, "0,1")

    }

    // ID: NCFD-00161; TAG: N0005; NAME: Laterality (SEER LATERAL)
    public boolean ncfd00161(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.laterality, "0,1,2,3,4,5,9")

    }

    // ID: NCFD-00163; TAG: N0445; NAME: Laterality, Primary Site, Morph ICDO3 (SEER IF42)
    public boolean ncfd00163(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        boolean paired_organ
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteLatMorph, "(1)"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") == 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9999", "(\\d\\d\\d\\d)"))
            return true
        if (dx_year > 1987 && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140,9700,9701,9590-9980", "(\\d\\d\\d\\d)"))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year >= 2021) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C444C443C445", 4) != 0) {
                if (functions.GEN_AT(untrimmedline.laterality, "0") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Laterality must not = 0 for Primary Site: ${untrimmedline.primarySite} for Date of Diagnosis >= 2021')
                else
                    return true
            }
        }
        if (dx_year >= 2018) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "090,091", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_AT(untrimmedline.laterality, "0"))
                    return true
            }
        }
        paired_organ = functions.GEN_ILOOKUP(untrimmedline.primarySite, context.NCFD_PAIRORGN, context.NCFD_PAIRORGN_PAIRSITE, [:]) || (dx_year > 1978 && functions.GEN_INLIST(untrimmedline.primarySite, "081,090,400-403,441,442,446,447,471,472,491,492", "(C\\d\\d\\d)", 2, 3))
        
        if (paired_organ) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                if (!functions.GEN_INLIST(untrimmedline.laterality, "1-3,5"))
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00164; TAG: N0841; NAME: Lymphoma ICDO3, Site, Summ Stg 1977 (NAACCR)
    public boolean ncfd00164(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.histologicTypeIcdO3, "9590-9699, 9702-9729")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "3,4"))
                    return false
            }
            if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "1"))
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00165; TAG: N0472; NAME: Morphology--Type/Behavior ICDO3 (SEER MORPH)
    public boolean ncfd00165(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int morphflg, i, benign_ok
        int dx_year
        char[] histbeh = new char[6]
        
        morphflg = 0
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year >= 2018 && functions.GEN_AT(untrimmedline.primarySite, "C723") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9421") != 0 && functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "1") != 0) {
            return true
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_HISICDO3, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_HISICDO3_HISTOLOGY, untrimmedline.histologicTypeIcdO3, [:]))
            return functions.GEN_ERROR_MSG(binding, 'Histologic Type not valid - ICDO3')
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9597,9688,9712,9724,9725,9726,9735,9737,9738,9759,9806") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9807,9808,9809,9811,9812,9813,9814,9815,9816,9817,9818") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9865,9869,9898,9911,9965,9966,9967,9971,9991,9992")) {
            if (dx_year < 2010)
                return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3 (${untrimmedline.histologicTypeIcdO3}) is not allowed if DX year < 2010')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8343") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (dx_year < 2017) {
                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} not allowed for diagnosis year < 2017')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8023,8054,8085,8086,8158,8163,8256,8257,8265,8339") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8474,8509,8519,8552,8594,8714,8975,9045,9086,9137,9385") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9395, 9396,9425, 9431, 9432, 9445, 9475, 9476, 9477") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9478, 9509, 9542")) {
            if (dx_year < 2018)
                return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} not allowed if diagnosis year < 2018')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8104,8273,8348,8349,8563,8643,8816,8817,8818,8828") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8992,9126,9138,9211,9212,9213,9222,9563,9715,9749") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9819,9877,9878 9879,9912,9968,9993")) {
            if (dx_year < 2021)
                return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} not allowed if diagnosis year < 2021')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8455,8483,8484,8859,8976,9111,9366,9367,9368")) {
            if (dx_year < 2022)
                return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} not allowed if diagnosis year < 2022')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9751,9831,9975") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
            if (dx_year < 2010) {
                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'If DX year < 2010, Behavior Code ICD-O-3 (${untrimmedline.behaviorCodeIcdO3}) is not allowed for Histologic Type ICD-O-3 (${untrimmedline.histologicTypeIcdO3})')
            }
            if (dx_year >= 2010) {
                if (functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Over-ride Histology is not required for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}/${untrimmedline.behaviorCodeIcdO3} for Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} and should not be used')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8311,8825,8842,8983,9302,9341") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
            if (dx_year < 2018) {
                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'if DX year < 2018 Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} not allowed for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
            }
            if (dx_year >= 2018) {
                if (functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Over-ride Histology is not required for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}/${untrimmedline.behaviorCodeIcdO3} for Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} and should not be used')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8158,8681,8682,8690,9766") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
            if (dx_year < 2021) {
                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'if DX year < 2021 Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} not allowed for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
            }
            if (dx_year >= 2021) {
                if (functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Over-ride Histology is not required for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}/${untrimmedline.behaviorCodeIcdO3} for Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} and should not be used')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9222") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
            if (dx_year < 2022) {
                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'if DX year < 2022 Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} not allowed for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
            }
            if (dx_year >= 2022) {
                if (functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Over-ride Histology is not required for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}/${untrimmedline.behaviorCodeIcdO3} for Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()} and should not be used')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9421")) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
                return functions.GEN_ERROR_MSG(binding, 'Behavior must be 3 for this histology')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8077")) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
                return functions.GEN_ERROR_MSG(binding, 'Behavior must be 2 for this histology')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8833, 9260, 9725, 9971") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
            if (dx_year > 2020) {
                if (!functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3"))
                    return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} not allowed if diagnosis year > 2020')
            }
        }
        if (functions.GEN_STRCMP(untrimmedline.behaviorCodeIcdO3, "2") == 0 && !functions.GEN_INLIST(untrimmedline.overRideHistology, "1,3")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8005,8020-8021,8331-8332") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-9055,9062-9062,9082-9083") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9110-9493,9501-9989"))
                return functions.GEN_ERROR_MSG(binding, 'Invalid Histology for In Situ - ICDO3')
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8519") && !functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
            return functions.GEN_ERROR_MSG(binding, 'Behavior must be 2 for this histology')
        if (dx_year >= 2018) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9540") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1"))
                return functions.GEN_ERROR_MSG(binding, 'Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3} with Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3} not allowed for 2018+ diagnosis')
        }
        return true

    }

    // ID: NCFD-00166; TAG: N0033; NAME: NAACCR Record Version (NAACCR)
    public boolean ncfd00166(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_STRCMP(untrimmedline.naaccrRecordVersion, "220") != 0)
            return false
        return true

    }

    // ID: NCFD-00167; TAG: N0739; NAME: NHIA Derived Hisp Origin (NAACCR)
    public boolean ncfd00167(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
        return functions.GEN_INLIST(untrimmedline.nhiaDerivedHispOrigin, "0-8")

    }

    // ID: NCFD-00168; TAG: N0736; NAME: Non-Reportable Skin ICDO3 (SEER IF117)
    public boolean ncfd00168(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8110"))
            return false
        return true

    }

    // ID: NCFD-00169; TAG: N1206; NAME: Obsolete Codes - CS Extension (CS)
    public boolean ncfd00169(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "2 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csExtension)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("2", table) == 0 && functions.GEN_STRCMP(untrimmedline.csExtension, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csExtension, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16 ") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16 ") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Extension=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00170; TAG: N1256; NAME: Obsolete Codes - CS Lymph Nodes (CS)
    public boolean ncfd00170(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "4 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csLymphNodes)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("4", table) == 0 && functions.GEN_STRCMP(untrimmedline.csLymphNodes, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csLymphNodes, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
        
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16 ") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16 ") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00171; TAG: N1260; NAME: Obsolete Codes - CS Lymph Nodes Eval (CS)
    public boolean ncfd00171(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "5 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csLymphNodesEval)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("5", table) == 0 && functions.GEN_STRCMP(untrimmedline.csLymphNodesEval, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csLymphNodesEval, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16 ") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16 ") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Lymph Nodes Eval=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00172; TAG: N1261; NAME: Obsolete Codes - CS Mets Eval (CS)
    public boolean ncfd00172(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsEval))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "9 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csMetsEval)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("9", table) == 0 && functions.GEN_STRCMP(untrimmedline.csMetsEval, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csMetsEval, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
        
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets Eval=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00173; TAG: N1257; NAME: Obsolete Codes - CS Mets at DX (CS)
    public boolean ncfd00173(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "8 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csMetsAtDx)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("8", table) == 0 && functions.GEN_STRCMP(untrimmedline.csMetsAtDx, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csMetsAtDx, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Mets at DX=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00174; TAG: 1817; NAME: Obsolete Codes - CS Site-Specific Factor 1 (Subm)
    public boolean ncfd00174(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Pleura,Breast,Lung,Brain,CNSOther,IntracranialGland,Prostate"))
            return true
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "10")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor1)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("10", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor1, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor1, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 1=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00175; TAG: 1818; NAME: Obsolete Codes - CS Site-Specific Factor 2 (Subm)
    public boolean ncfd00175(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma"))
            return true
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "11")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor2)
        
        if (functions.GEN_INLIST(t_schema_name, "MelanomaIris"))
            return true
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("11", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor2, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor2, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 2=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00177; TAG: 1820; NAME: Obsolete Codes - CS Site-Specific Factor15 (Subm)
    public boolean ncfd00177(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "24")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor15)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("24", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor15, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor15, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor15=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00178; TAG: N1268; NAME: Obsolete Codes - CS Site-Specific Factor25 (CS)
    public boolean ncfd00178(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "34")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor25)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("34", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor25, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor25, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor25=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00179; TAG: N1258; NAME: Obsolete Codes - CS Tumor Size (CS)
    public boolean ncfd00179(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSize))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name) /*
        StrCpy(t_sch_code, t_schema_name,-27);
        StrCat(t_sch_code, "CS Tumor Size                  ");
        StrCat (t_sch_code, #S"CS Tumor Size");
        */
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "1 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csTumorSize)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("1", table) == 0 && functions.GEN_STRCMP(untrimmedline.csTumorSize, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csTumorSize, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00180; TAG: N1259; NAME: Obsolete Codes - CS Tumor Size/Ext Eval (CS)
    public boolean ncfd00180(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name) /*
        StrCpy(t_sch_code, t_schema_name,-27);
        StrCat(t_sch_code, "CS Tumor Size/Ext Eval                  ");
        StrCat (t_sch_code, #S"CS Tumor Size/Ext Eval");
        */
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "3 ")
        functions.GEN_STRCAT(t_index1, untrimmedline.csTumorSizeExtEval)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("3", table) == 0 && functions.GEN_STRCMP(untrimmedline.csTumorSizeExtEval, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csTumorSizeExtEval, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Tumor Size/Ext Eval=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00181; TAG: N0714; NAME: PIN III ICDO3, Date of Diagnosis (SEER IF110)
    public boolean ncfd00181(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8148") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
                return false
        }
        return true

    }

    // ID: NCFD-00182; TAG: N0058; NAME: Patient ID Number (SEER CASENUM)
    public boolean ncfd00182(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.patientIdNumber, "(\\d\\d\\d\\d\\d\\d\\d\\d)") && functions.GEN_VAL(untrimmedline.patientIdNumber) > 0)
            return true
        else
            return false
        
        return true

    }

    // ID: NCFD-00183; TAG: N0811; NAME: Primary Payer at DX (NPCR)
    public boolean ncfd00183(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.primaryPayerAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.primaryPayerAtDx, "01,02,10,20,21,31,35,60-68,99"))
            return true
        return false

    }

    // ID: NCFD-00184; TAG: N0007; NAME: Primary Site (SEER SITE)
    public boolean ncfd00184(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_LOOKUP(untrimmedline.primarySite, context.NCFD_SITE_TBL, context.NCFD_SITE_TBL_SITECODE, [:])

    }

    // ID: NCFD-00185; TAG: N0476; NAME: Primary Site, Behavior Code ICDO3 (SEER IF39)
    public boolean ncfd00185(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.behaviorCodeIcdO3, "2") == 0) {
            if (functions.GEN_MATCH(untrimmedline.primarySite, "(C269)|(C399)|(C559)|(C579)|(C639)|(C689)|(C729)|(C759)|(C76[0-8])|(C809)"))
                return false
        }
        return true

    }

    // ID: NCFD-00187; TAG: N0390; NAME: Primary Site, Laterality (SEER IF82)
    public boolean ncfd00187(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (!functions.GEN_INLIST(untrimmedline.primarySite, "342", "(C\\d\\d\\d)", 2, 3))
            return true
        if (functions.GEN_INLIST(untrimmedline.laterality, "2"))
            return functions.GEN_ERROR_MSG(binding, 'C342 (lung, middle lobe), Laterality cannot equal 2 (left)')
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006) {
            if (functions.GEN_INLIST(untrimmedline.laterality, "4"))
                return functions.GEN_ERROR_MSG(binding, 'If DX > 2006 and site= C342 (lung, middle lobe), Laterality cannot=4 (bilateral)')
        }
        return true

    }

    // ID: NCFD-00188; TAG: N0446; NAME: Primary Site, Morphology-Imposs ICDO3 (SEER IF38)
    public boolean ncfd00188(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] site = new char[5], histlo = new char[5], histhi = new char[5]
        
        char[] SiteHist = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-709,728-750,752,754-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9440-9442")) {
            return false
        }
        functions.GEN_STRCPY(SiteHist, untrimmedline.primarySite)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologicTypeIcdO3)
        
        if (functions.GEN_RLOOKUP(SiteHist, context.NCFD_IF38IM01, context.NCFD_IF38IM01_SITEHISTLO, ['SITE':site, 'HISTLO':histlo, 'HISTHI':histhi])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, site) == 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, histlo) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, histhi) <= 0)
                return false
        }
        
        return true

    }

    // ID: NCFD-00189; TAG: N1254; NAME: Primary Site, Morphology-Type, Beh ICDO3 (SEER IF25)
    public boolean ncfd00189(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] SITE_LO = new char[5], SITE_HI = new char[5], SITE = new char[5], HIST = new char[5], BEH = new char[2]
        
        char[] SiteHistBeh = new char[11]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)")) {
            return true
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_IF25_REF, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_IF25_REF_SITE_LO, untrimmedline.primarySite, ['SITE_LO':SITE_LO, 'SITE_HI':SITE_HI])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITE_LO) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITE_HI) <= 0)
                functions.GEN_STRCPY(SiteGrp, SITE_LO)
            else {
                return false
            }
        }
        functions.GEN_STRCPY(SiteHistBeh, SiteGrp)
        functions.GEN_STRCAT(SiteHistBeh, untrimmedline.histologicTypeIcdO3, 4)
        functions.GEN_STRCAT(SiteHistBeh, untrimmedline.behaviorCodeIcdO3, 1)
        
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_IF25_3, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_IF25_3_SITEHISTBEH, SiteHistBeh, ['SITE':SITE, 'HIST':HIST, 'BEH':BEH]))
            return true
        else
            return false
        
        return true

    }

    // ID: NCFD-00219; TAG: N0011; NAME: Race 1 (SEER RACE)
    public boolean ncfd00219(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: NCFD-00221; TAG: N0409; NAME: Race 2 (NAACCR)
    public boolean ncfd00221(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: NCFD-00222; TAG: N0413; NAME: Race 2, Date of DX (SEER IF89)
    public boolean ncfd00222(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_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: NCFD-00223; TAG: N0958; NAME: Race--NAPIIA(derived API) (NAACCR)
    public boolean ncfd00223(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: NCFD-00228; TAG: N0062; NAME: Record Type (NAACCR)
    public boolean ncfd00228(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: NCFD-00230; TAG: N1247; NAME: Regional Nodes Examined (NAACCR)
    public boolean ncfd00230(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: NCFD-00231; TAG: N1248; NAME: Regional Nodes Positive (NAACCR)
    public boolean ncfd00231(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: NCFD-00233; TAG: N0777; NAME: RuralUrban Continuum 1993 (NAACCR)
    public boolean ncfd00233(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: NCFD-00234; TAG: N0778; NAME: RuralUrban Continuum 2003 (NAACCR)
    public boolean ncfd00234(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: NCFD-00236; TAG: N0228; NAME: Sequence Number--Central (SEER SEQUENC)
    public boolean ncfd00236(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: NCFD-00237; TAG: N0012; NAME: Sex (SEER Sex)
    public boolean ncfd00237(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: NCFD-00238; TAG: N0013; NAME: Sex, Primary Site (SEER IF17)
    public boolean ncfd00238(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: NCFD-00241; TAG: N0014; NAME: Spanish/Hispanic Origin (SEER SPANORIG)
    public boolean ncfd00241(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: NCFD-00242; TAG: N1033; NAME: Spanish/Hispanic Origin, NHIA Derived (NAACCR)
    public boolean ncfd00242(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: NCFD-00243; TAG: N1616; NAME: Summ Stg 2000, Site, Hist ICDO3, Rpt Srce (NAACCR)
    public boolean ncfd00243(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.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NCFD_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: NCFD-00244; TAG: N0202; NAME: Summary Stage 1977 (NAACCR)
    public boolean ncfd00244(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: NCFD-00246; TAG: N0496; NAME: Summary Stage 1977, Summary Stage 2000 (NAACCR)
    public boolean ncfd00246(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.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NCFD_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: NCFD-00247; TAG: N0530; NAME: Summary Stage 1977, Type of Report Source (NAACCR)
    public boolean ncfd00247(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: NCFD-00248; TAG: N0438; NAME: Summary Stage 2000 (NAACCR)
    public boolean ncfd00248(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: NCFD-00250; TAG: N1594; NAME: Summary Stage 2000, Over-ride CS 20 (NPCR)
    public boolean ncfd00250(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: NCFD-00262; TAG: N0457; NAME: Type of Rep Srce(DC),Seq Num--Cent,ICDO3 (SEER IF04)
    public boolean ncfd00262(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.overRideReportSource, "1")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7") && (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9589", "(\\d\\d\\d\\d)"))) {
            if (!functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00,60"))
                return false
        }
        return true

    }

    // ID: NCFD-00263; TAG: N0017; NAME: Type of Report Srce (AO), Date of Dx (SEER IF02)
    public boolean ncfd00263(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, dx_month, dolc_year, dolc_month
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (dolc_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dolc_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
        dolc_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfLastContact)
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (dx_year == dolc_year) {
                if (dx_month == dolc_month)
                    return true
                else
                    return false
            }
            else
                return false
        }
        return true

    }

    // ID: NCFD-00264; TAG: N0094; NAME: Type of Report Srce(DC/AO), COD (SEER IF09)
    public boolean ncfd00264(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000")) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.causeOfDeath, "7777")) {
            if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
                return false
        }
        return true

    }

    // ID: NCFD-00265; TAG: N0018; NAME: Type of Report Srce(DC/AO), Diag Conf (SEER IF05)
    public boolean ncfd00265(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1,6"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "9"))
                return false
        }
        return true

    }

    // ID: NCFD-00266; TAG: N0307; NAME: Type of Report Srce(DC/AO), Vital Stat (SEER IF08)
    public boolean ncfd00266(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")) {
            if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        return true

    }

    // ID: NCFD-00267; TAG: N0019; NAME: Type of Reporting Source (SEER RPRTSRC)
    public boolean ncfd00267(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "1-8")

    }

    // ID: NCFD-00268; TAG: N0842; NAME: Unknown Site, Hist ICDO3, Summ Stg 1977 (NAACCR)
    public boolean ncfd00268(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.histologicTypeIcdO3, "9140,9590-9699,9702-9729,9731-9989"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00269; TAG: N0407; NAME: Unknown Site, Laterality (SEER IF138)
    public boolean ncfd00269(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.primarySite, "C809")) {
            if (functions.GEN_INLIST(untrimmedline.laterality, "0"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00324; TAG: N0051; NAME: ICD Revision Number (SEER ICDCODE)
    public boolean ncfd00324(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.icdRevisionNumber))
            return true
        return functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0-1,7-9")

    }

    // ID: NCFD-00408; TAG: N0996; NAME: CS Site-Specific Factor 8 (CS)
    public boolean ncfd00408(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor8, "(\\d\\d\\d)")

    }

    // ID: NCFD-00413; TAG: N0998; NAME: CS Site-Specific Factor10 (CS)
    public boolean ncfd00413(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor10, "(\\d\\d\\d)")

    }

    // ID: NCFD-00431; TAG: N1678; NAME: Census Tr Poverty Indictr (SEER)
    public boolean ncfd00431(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTrPovertyIndictr))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusTrPovertyIndictr, "1-4,9"))
            return false
        
        return true

    }

    // ID: NCFD-00451; TAG: 2026; NAME: Obsolete Codes - CS Site-Specific Factor 8 (Subm)
    public boolean ncfd00451(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "17")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor8)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("17", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor8, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor8, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor 8=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00453; TAG: 2027; NAME: Obsolete Codes - CS Site-Specific Factor10 (Subm)
    public boolean ncfd00453(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[33], table = new char[3], code_low = new char[5], code_high = new char[5], obs_type = new char[3], index1 = new char[100]
        char[] t_index1 = new char[100]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        char[] t_sch_code = new char[61]
        char[] t_descr = new char[51]
        char[] t_obs_type = new char[3]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        functions.GEN_STRCPY(t_index1, t_schema_name, -32)
        functions.GEN_STRCAT(t_index1, "19")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor10)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NCFD_CS_OBS, context.NCFD_CS_OBS_INDEX1, ['SCHEMA':schema, 'TABLE':table, 'CODE_LOW':code_low, 'CODE_HIGH':code_high, 'OBS_TYPE':obs_type, 'INDEX1':index1])) {
            if (functions.GEN_STRCMP(t_schema_name, schema) == 0 && functions.GEN_STRCMP("19", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor10, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor10, code_high) <= 0) {
                functions.GEN_STRCPY(t_obs_type, obs_type)
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,6 ,7 ,16") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "2 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA CONVERTED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "3 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA CONVERTED V0104')
                }
                if (functions.GEN_INLIST(t_obs_type, "4 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA CONVERTED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "8 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED AND CHANGED V0102')
                }
                if (functions.GEN_INLIST(t_obs_type, "9 ")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED AND CHANGED V0103')
                }
                if (functions.GEN_INLIST(t_obs_type, "10")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED AND CHANGED V0200')
                }
                if (functions.GEN_INLIST(t_obs_type, "11")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED AND CHANGED V0203')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "13") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "14") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED AND REVIEWED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED V0203 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "15") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20300)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED V0203 - not allowed if CS Version Input Original > or = 020300')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && dx_year > 2010)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED V0202 - not allowed if DX > 2010')
                }
                if ((functions.GEN_INLIST(t_obs_type, "17") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20200)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED V0202 - not allowed if CS Version Input Original > or = 020200')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && dx_year > 2009)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "18") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED AND REVIEWED V0200 - not allowed if CS Version Input Original > or = 020100')
                }
                if (functions.GEN_INLIST(t_obs_type, "19")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA CONVERTED V0204')
                }
                if (functions.GEN_INLIST(t_obs_type, "20")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA REVIEWED AND CHANGED V0204')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "21") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20440)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED AND REVIEWED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && dx_year > 2011)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED V0204 - not allowed if DX > 2011')
                }
                if ((functions.GEN_INLIST(t_obs_type, "22") && functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20330)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'CS Site-Specific Factor10=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NCFD-00456; TAG: N1966; NAME: Obsolete Histology ICDO3, Date of DX (SEER)
    public boolean ncfd00456(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] GROUP = new char[2], OBSYEAR = new char[5], HISTOBS = new char[5], HISTUSE = new char[5]
        int dx_year
        char[] compare_year = new char[10]
        char[] message = new char[100]
        char[] histo = new char[40]
        char[] code = new char[7]
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            return true
        }
        functions.GEN_STRCPY(histo, "8444 8462 8463 8473 8965 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCAT(code, " ")
        
        if (dx_year >= 2021) {
            if (functions.GEN_AT(code, histo, 5) != 0)
                functions.GEN_SAVE_TEXT(binding, 'Check ICD-O-3.2 and Solid Tumor Rules for reportability and histology coding.')
        }
        if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_OBSHISTO, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_OBSHISTO_HISTOBS, untrimmedline.histologicTypeIcdO3, ['GROUP':GROUP, 'OBSYEAR':OBSYEAR, 'HISTUSE':HISTUSE, 'HISTOBS':HISTOBS]))
            return true
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_OBSHISTO, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_OBSHISTO_HISTOBS, untrimmedline.histologicTypeIcdO3, ['GROUP':GROUP, 'OBSYEAR':OBSYEAR, 'HISTUSE':HISTUSE, 'HISTOBS':HISTOBS])) {
            functions.GEN_STRCPY(compare_year, OBSYEAR)
        
            if (dx_year >= functions.GEN_VAL(compare_year)) {
                functions.GEN_STRCPY(message, HISTUSE)
                functions.GEN_STRCAT(message, " replaces ")
                functions.GEN_STRCAT(message, HISTOBS)
                functions.GEN_STRCAT(message, " for diagnosis year")
                if (functions.GEN_AT(GROUP, "1") != 0)
                    functions.GEN_SAVE_TEXT(binding, message)
                else {
                    if (functions.GEN_AT(GROUP, "2") != 0)
                        return false
                }
            }
        }
        return true

    }

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

    }

    // ID: NCFD-00460; TAG: N0448; NAME: Seq Num--Central, Prim Site, Morph ICDO3 (SEER IF22)
    public boolean ncfd00460(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_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: NCFD-00521; TAG: N2060; NAME: County at DX Geocode2000 (NAACCR)
    public boolean ncfd00521(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDxGeocode2000))
            return true
        return functions.GEN_INLIST(untrimmedline.countyAtDxGeocode2000, "001-999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00522; TAG: N2061; NAME: County at DX Geocode2010 (NAACCR)
    public boolean ncfd00522(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDxGeocode2010))
            return true
        return functions.GEN_INLIST(untrimmedline.countyAtDxGeocode2010, "001-999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00585; TAG: N2292; NAME: Tumor Size Summary, Primary Site (COC)
    public boolean ncfd00585(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int req_flag
        int dx_year
        
        char[] code = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2016 || dx_year > 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        if (functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "199, 209, 180, 182-189,150-155, 158, 159", "(C\\d\\d\\d)", 2, 4) && !functions.GEN_INLIST(untrimmedline.primarySite, "160-166, 168, 169, 340-343, 348, 349, 500-506, 508, 509", "(C\\d\\d\\d)", 2, 4))
                return false
        }
        return true

    }

    // ID: NCFD-00597; TAG: 1846; NAME: CS Validate Schema  (Subm)
    public boolean ncfd00597(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2004)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        return true

    }

    // ID: NCFD-00598; TAG: N2042; NAME: County at DX Geocode 1970/80/90 (NAACCR)
    public boolean ncfd00598(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDxGeocode1990))
            return true
        return functions.GEN_INLIST(untrimmedline.countyAtDxGeocode1990, "001-999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00627; TAG: 2122; NAME: Derived Items, Date of DX (Subm)
    public boolean ncfd00627(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2015)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003 && dx_year < 2016) && functions.GEN_EMPTY(untrimmedline.overRideCs20)) {
            if (functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2016, Derived SS2000 cannot be blank')
                err_flag = 1
            }
            if (err_flag == 1)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1")) {
            if (!functions.GEN_EMPTY(untrimmedline.derivedSs2000)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = 1, Derived SS2000 must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00629; TAG: N2938; NAME: Brain Molecular Markers, Date DX (NAACCR)
    public boolean ncfd00629(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers))
            return true
        if (!functions.GEN_INLIST(untrimmedline.brainMolecularMarkers, "01-09, 85-88, 99", "(\\d\\d)"))
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.brainMolecularMarkers} not valid code for Brain Molecular Markers')
        return true

    }

    // ID: NCFD-00630; TAG: N0090; NAME: Vital Status (COC)
    public boolean ncfd00630(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.vitalStatus, "0,1")

    }

    // ID: NCFD-00631; TAG: N3006; NAME: Schema Discriminator 2, Date DX (NAACCR)
    public boolean ncfd00631(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        functions.GEN_NOOP()
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator2))
            return true
        if (functions.GEN_AT(untrimmedline.schemaDiscriminator2, "1289", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.schemaDiscriminator2} is not a valid value for Schema Discriminator 2')
        if (functions.GEN_AT(untrimmedline.schemaDiscriminator2, "8") != 0) {
            if (dx_year >= 2021)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 2: ${untrimmedline.schemaDiscriminator2} must not be used for 2021+ diagnoses')
        }
        return true

    }

    // ID: NCFD-00632; TAG: 2123; NAME: Cause of Death (Subm)
    public boolean ncfd00632(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.causeOfDeath))
            return true
        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\d)") || functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\d)") || functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\s)") || functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\s)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NCFD-00634; TAG: N3032; NAME: Brain Molecular Markers, Morph--Type&Behav ICD-O-3 (NAACCR)
    public boolean ncfd00634(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[14]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            return true
        }
        functions.GEN_STRCPY(ID, "00721 00722 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) || functions.GEN_AT(untrimmedline.brainMolecularMarkers, "88") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "0102", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94003") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "0304", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94013") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "05", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94403") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "06", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94503") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "07", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94513") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "08", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94713") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "09", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94783") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "85", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.morphTypebehavIcdO3, "94003940139440394503945139471394783", 5) != 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "86", 2) != 0) {
            if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} is not valid for Morph--Type&Behav ICD-O-3: ${untrimmedline.morphTypebehavIcdO3}')
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.brainMolecularMarkers, "86", 2) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Brain Molecular Markers: ${untrimmedline.brainMolecularMarkers} is not valid for Morph--Type&Behav ICD-O-3: ${untrimmedline.morphTypebehavIcdO3}')
        }
        return true

    }

    // ID: NCFD-00635; TAG: N3033; NAME: Breslow Tumor Thickness, Melanoma, Behavior (NAACCR)
    public boolean ncfd00635(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] Breslow = new char[4]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470", 5) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.breslowTumorThickness) || functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.8") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.9", 4) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Breslow Tumor Thickness: ${untrimmedline.breslowTumorThickness} not valid for Behavior Code ICD-O-3: ${untrimmedline.behaviorCodeIcdO3}')
        }
        return true

    }

    // ID: NCFD-00638; TAG: N2803; NAME: Grade, Schema ID (NAACCR)
    public boolean ncfd00638(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31], Grade = new char[2]
        
        int dx_year
        
        char[] name = new char[50]
        
        
        char[] group_cgrade = new char[7]
        char[] group_pgrade = new char[7]
        char[] group_ycgrade = new char[7]
        char[] group_ypgrade = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(untrimmedline.schemaId, "09520") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.gradeClinical)) {
                functions.GEN_STRCPY(group_cgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_cgrade, untrimmedline.gradeClinical)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADE09_SCHEMA_IDGRADE, group_cgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradePathological)) {
                functions.GEN_STRCPY(group_pgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_pgrade, untrimmedline.gradePathological)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADE09_SCHEMA_IDGRADE, group_pgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin)) {
                functions.GEN_STRCPY(group_ycgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_ycgrade, untrimmedline.gradePostTherapyClin)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADE09_SCHEMA_IDGRADE, group_ycgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
        
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Clin (yc): ${untrimmedline.gradePostTherapyClin} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
                functions.GEN_STRCPY(group_ypgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_ypgrade, untrimmedline.gradePostTherapy)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADE09, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADE09_SCHEMA_IDGRADE, group_ypgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
        
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.gradeClinical)) {
                functions.GEN_STRCPY(group_cgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_cgrade, untrimmedline.gradeClinical)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADEED8_SCHEMA_IDGRADE, group_cgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradePathological)) {
                functions.GEN_STRCPY(group_pgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_pgrade, untrimmedline.gradePathological)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADEED8_SCHEMA_IDGRADE, group_pgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin)) {
                functions.GEN_STRCPY(group_ycgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_ycgrade, untrimmedline.gradePostTherapyClin)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADEED8_SCHEMA_IDGRADE, group_ycgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
        
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Clin (yc): ${untrimmedline.gradePostTherapyClin} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
                functions.GEN_STRCPY(group_ypgrade, untrimmedline.schemaId)
                functions.GEN_STRCAT(group_ypgrade, untrimmedline.gradePostTherapy)
        
                if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_GRADEED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_GRADEED8_SCHEMA_IDGRADE, group_ypgrade, ['SCHEMA_ID':SCHEMA_ID, 'GRADE':Grade])) {
        
                    functions.GEN_SAVE_TEXT(binding, name)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Path (yp): ${untrimmedline.gradePostTherapy} is not valid for Schema ID: ${untrimmedline.schemaId}')
                }
            }
        }
        return true

    }

    // ID: NCFD-00644; TAG: N0251; NAME: Vital Status, Cause of Death (NPCR)
    public boolean ncfd00644(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.vitalStatus) || functions.GEN_EMPTY(untrimmedline.causeOfDeath))
            return true
        if (functions.GEN_VAL(untrimmedline.vitalStatus) == 1 && !functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000"))
            return false
        if (functions.GEN_VAL(untrimmedline.vitalStatus) == 0 && functions.GEN_INLIST(untrimmedline.causeOfDeath, "0000"))
            return false
        return true

    }

    // ID: NCFD-00647; TAG: 3139; NAME: SSDI for Prostate, Blank for Other Schemas (Subm)
    public boolean ncfd00647(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00580") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00580") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.psaLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Prostate, PSA Lab Value must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00648; TAG: N3082; NAME: Grade, Lymphoma Ocular Adnexa, Histologic Type ICD-O-3 (NAACCR)
    public boolean ncfd00648(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00710") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9690, 9691, 9695, 9698")) {
            if (!functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_AT(untrimmedline.gradeClinical, "9", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Clinical: ${untrimmedline.gradeClinical} is not valid for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
            if (!functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_AT(untrimmedline.gradePathological, "9", 1) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Pathological: ${untrimmedline.gradePathological} is not valid for Histologic Type ICD-O-3: ${untrimmedline.histologicTypeIcdO3}')
        }
        return true

    }

    // ID: NCFD-00654; TAG: 3143; NAME: SSDI for Liver & Biliary, Blank for Other Schemas (Subm)
    public boolean ncfd00654(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00220 00230 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Liver or Intrehepatic Bile Duct, Fibrosis Score must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00655; TAG: 3144; NAME: SSDI for Melanoma of Skin, Blank for Other Schemas (Subm)
    public boolean ncfd00655(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, Breslow Tumor Thickness must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Melanoma of Skin, LDH Pretreatment Lab Value must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00660; TAG: N2569; NAME: County at DX Analysis (NAACCR)
    public boolean ncfd00660(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDxAnalysis))
            return true
        return functions.GEN_INLIST(untrimmedline.countyAtDxAnalysis, "001-997, 998, 999", "(\\d\\d\\d)")

    }

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

    }

    // ID: NCFD-00670; TAG: N3964; NAME: Regional Nodes Positive, Examined, Primary Site, 2018 (NAACCR)
    public boolean ncfd00670(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int rnp, rne
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            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)
        
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,589,700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if ((rne != 99) || (rnp != 99))
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Examined and Regional Nodes Positive must both = 99 for Primary Site')
            else
                return true
        }
        return true

    }

    // ID: NCFD-00671; TAG: N2655; NAME: Breslow Tumor Thickness, Date DX (NAACCR)
    public boolean ncfd00671(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, len
        
        char[] Breslow = new char[5]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Breslow Tumor Thickness must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.breslowTumorThickness))
            return true
        functions.GEN_STRCPY(Breslow, functions.GEN_TRIM(untrimmedline.breslowTumorThickness, ((Integer)context.NCFD_GEN_BOTH)))
        
        len = (functions.GEN_STRLEN(Breslow))
        
        if (len == 1 || len == 2)
            return false
        if (len == 3) {
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(Breslow, 2, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Breslow Tumor Thickness must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(Breslow, "(\\d\\.\\d)"))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.breslowTumorThickness} not valid code for Breslow Tumor Thickness')
        }
        if (len == 4) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(Breslow, 3, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Breslow Tumor Thickness must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(Breslow, "((([1-9]))\\d\\.\\d)") || functions.GEN_MATCH(Breslow, "(((A))\\d\\.\\d)") || functions.GEN_AT(Breslow, "AX.0XX.1XX.8XX.9", 4) != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00672; TAG: N2656; NAME: LDH Lab Value, Date DX (NAACCR)
    public boolean ncfd00672(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, len
        
        char[] LDH = new char[8]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue))
            return true
        functions.GEN_STRCPY(LDH, functions.GEN_TRIM(untrimmedline.ldhPretreatmentLabValue, ((Integer)context.NCFD_GEN_BOTH)))
        
        len = (functions.GEN_STRLEN(LDH))
        
        if (len == 1 || len == 2)
            return false
        if (len == 3) {
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(LDH, 2, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(LDH, "(\\d\\.\\d)"))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.ldhPretreatmentLabValue} not valid code for LDH Lab Value')
        }
        if (len == 4) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(LDH, 3, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(LDH, "((([1-9]))\\d\\.\\d)"))
                return true
            else
                return false
        }
        if (len == 5) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(LDH, 4, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(LDH, "((([1-9]))\\d\\d\\.\\d)"))
                return true
            else
                return false
        }
        if (len == 6) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(LDH, 5, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(LDH, "((([1-9]))\\d\\d\\d\\.\\d)"))
                return true
            else
                return false
        }
        if (len == 7) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(LDH, 6, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'LDH Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(LDH, "((([1-9]))\\d\\d\\d\\d\\.\\d)") || functions.GEN_AT(LDH, "XXXXX.1XXXXX.7XXXXX.8XXXXX.9", 7) != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00673; TAG: N2694; NAME: Microsatellite Instability (MSI), Date DX (NAACCR)
    public boolean ncfd00673(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Microsatellite Instability (MSI) must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.microsatelliteInstability))
            return true
        if (functions.GEN_AT(untrimmedline.microsatelliteInstability, "01289", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.microsatelliteInstability} not valid code for Microsatellite Instability (MSI)')
        return true

    }

    // ID: NCFD-00679; TAG: N2720; NAME: Fibrosis Score, Date DX (NAACCR)
    public boolean ncfd00679(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Fibrosis Score must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.fibrosisScore))
            return true
        if (functions.GEN_AT(untrimmedline.fibrosisScore, "01789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.fibrosisScore} not valid code for Fibrosis Score')
        return true

    }

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

    }

    // ID: NCFD-00682; TAG: N2733; NAME: Estrogen Receptor Summary, Date DX (NAACCR)
    public boolean ncfd00682(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Estrogen Receptor Summary must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary))
            return true
        if (functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.estrogenReceptorSummary} not valid code for Estrogen Receptor Summary')
        return true

    }

    // ID: NCFD-00683; TAG: N2734; NAME: Progesterone Receptor Summary, Date DX (NAACCR)
    public boolean ncfd00683(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Progesterone Receptor Summary must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary))
            return true
        if (functions.GEN_AT(untrimmedline.progesteroneRecepSummary, "0179", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.progesteroneRecepSummary} not valid code for Progesterone Receptor Summary')
        return true

    }

    // ID: NCFD-00684; TAG: N2735; NAME: HER2 Overall Summary, Date DX (NAACCR)
    public boolean ncfd00684(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SCHEMA_ID = new char[6], SCHEMA_NAME = new char[31]
        
        int dx_year
        char[] name = new char[50]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary)) {
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 Overall Summary must be blank for cases diagnosed before 2018')
            }
        }
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_SCHEMA_ID_NAMES, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_SCHEMA_ID_NAMES_SCHEMA_ID, untrimmedline.schemaId, ['SCHEMA_ID':SCHEMA_ID, 'SCHEMA_NAME':SCHEMA_NAME]))
            functions.GEN_STRCPY(name, "Schema ")
        functions.GEN_STRCAT(name, untrimmedline.schemaId)
        functions.GEN_STRCAT(name, ": ")
        functions.GEN_STRCAT(name, functions.GEN_TRIM(SCHEMA_NAME, ((Integer)context.NCFD_GEN_RIGHT)))
        
        char[] ID = new char[25]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00161 00169 00170 ")
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (dx_year < 2021 && functions.GEN_AT(code, ID, 6) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary)) {
                functions.GEN_SAVE_TEXT(binding, name)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 Overall Summary must be blank for Schema ID: ${untrimmedline.schemaId} cases diagnosed before 2021')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.her2OverallSummary))
            return true
        if (functions.GEN_AT(untrimmedline.her2OverallSummary, "01789", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.her2OverallSummary} not valid code for HER2 Overall Summary')
        if (functions.GEN_AT(untrimmedline.her2OverallSummary, "8") != 0) {
            if (functions.GEN_AT(code, ID, 6) == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'HER2 Overall Summary: ${untrimmedline.her2OverallSummary} not valid for Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: NCFD-00685; TAG: N2737; NAME: PSA (Prostatic Specific Antigen) Lab Value, Date DX (NAACCR)
    public boolean ncfd00685(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, len
        
        char[] PSA = new char[6]
        char[] decimal = new char[2]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.psaLabValue))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'PSA (Prostatic Specific Antigen) Lab Value must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.psaLabValue))
            return true
        functions.GEN_STRCPY(PSA, functions.GEN_TRIM(untrimmedline.psaLabValue, ((Integer)context.NCFD_GEN_BOTH)))
        
        len = (functions.GEN_STRLEN(PSA))
        
        if (len == 1 || len == 2)
            return false
        if (len == 3) {
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(PSA, 2, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'PSA (Prostatic Specific Antigen) Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(PSA, "(\\d\\.\\d)"))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.psaLabValue} not valid code for PSA (Prostatic Specific Antigen) Lab Value')
        }
        if (len == 4) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(PSA, 3, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'PSA (Prostatic Specific Antigen) Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(PSA, "((([1-9]))\\d\\.\\d)"))
                return true
            else
                return false
        }
        if (len == 5) {
        
            functions.GEN_STRCPY(decimal, functions.GEN_SUBSTR(PSA, 4, 1))
        
            if (functions.GEN_AT(decimal, ".") == 0)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'PSA (Prostatic Specific Antigen) Lab Value must have at least 1 digit followed by decimal followed by digit')
            if (functions.GEN_MATCH(PSA, "((([1-9]))\\d\\d\\.\\d)") || functions.GEN_AT(PSA, "XXX.1XXX.2XXX.3XXX.7XXX.9", 5) != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00689; TAG: N2760; NAME: Schema Discriminator 1, Date DX (NAACCR)
    public boolean ncfd00689(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018) {
            if (!functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Schema Discriminator 1 must be blank for cases diagnosed before 2018')
        }
        if (functions.GEN_EMPTY(untrimmedline.schemaDiscriminator1))
            return true
        if (functions.GEN_AT(untrimmedline.schemaDiscriminator1, "012345679", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, '${untrimmedline.schemaDiscriminator1} is not a valid value for Schema Discriminator 1')
        return true

    }

    // ID: NCFD-00691; TAG: N2810; NAME: CoC Accredited Flag (NPCR)
    public boolean ncfd00691(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.cocAccreditedFlag))
            return true
        if (functions.GEN_AT(untrimmedline.cocAccreditedFlag, "012", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00692; TAG: N2811; NAME: CoC Accredited Flag, Date DX, Type Report Source (NAACCR)
    public boolean ncfd00692(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0) {
            if (functions.GEN_EMPTY(untrimmedline.cocAccreditedFlag))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CoC Accredited Flag must not be blank for cases diagnosed 2018 and later')
        }
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.cocAccreditedFlag))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CoC Accredited Flag must be blank for Type of Reporting Source = 7, DCO')
        }
        return true

    }

    // ID: NCFD-00695; TAG: N2846; NAME: SEER Cause-Specific COD (NAACCR)
    public boolean ncfd00695(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerCauseSpecificCod))
            return true
        if (functions.GEN_AT(untrimmedline.seerCauseSpecificCod, "0189", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00696; TAG: N2847; NAME: SEER Other COD (NAACCR)
    public boolean ncfd00696(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerOtherCod))
            return true
        if (functions.GEN_AT(untrimmedline.seerOtherCod, "0189", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00697; TAG: N2848; NAME: Vital Status Recode (NAACCR)
    public boolean ncfd00697(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.vitalStatusRecode))
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatusRecode, "01", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00698; TAG: N2849; NAME: URIC 2000 (NAACCR)
    public boolean ncfd00698(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.uric2000))
            return true
        if (functions.GEN_AT(untrimmedline.uric2000, "12349ABCD", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00699; TAG: N2850; NAME: URIC 2010 (NAACCR)
    public boolean ncfd00699(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.uric2010))
            return true
        if (functions.GEN_AT(untrimmedline.uric2010, "12349ABCD", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00706; TAG: 3164; NAME: CS Items, Type Reporting Source-DCO (Subm-NAACCR)
    public boolean ncfd00706(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year, err_flag
        
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.csTumorSize) && !functions.GEN_INLIST(untrimmedline.csTumorSize, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Tumor Size (${untrimmedline.csTumorSize}) must = 988 or 999')
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "050,999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 050 or 999')
            else
                functions.GEN_NOOP()
        }
        else {
            if (functions.GEN_INLIST(t_schema_name, "HemeRetic")) {
                if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "800,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 800 or 999')
                else
                    functions.GEN_NOOP()
            }
            else {
                if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "800,810,820,999"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 800, 810, 820, or 999')
                    else
                        functions.GEN_NOOP()
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "LymphomaOcularAdnexa")) {
                        if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "989,999"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 989 or 999')
                        else
                            functions.GEN_NOOP()
                    }
                    else {
                        if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "988,999"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 988 or 999')
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) && !functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}) must = 9')
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "987,988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Lymph Nodes (${untrimmedline.csLymphNodes}) must = 987, 988, or 999')
                else
                    functions.GEN_NOOP()
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Lymph Nodes (${untrimmedline.csLymphNodes}) must = 988 or 999')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) && !functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Lymph Nodes Eval (${untrimmedline.csLymphNodesEval}) must = 9')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx) && !functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98,99"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets at DX (${untrimmedline.csMetsAtDx}) must = 98 or 99')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsEval) && !functions.GEN_INLIST(untrimmedline.csMetsEval, "9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets Eval (${untrimmedline.csMetsEval}) must = 9')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988,999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1}) must = 988 or 999')
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
        
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988,999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 2 (${untrimmedline.csSiteSpecificFactor2}) must = 988 or 999')
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 8 (${untrimmedline.csSiteSpecificFactor8}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor10 (${untrimmedline.csSiteSpecificFactor10}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor15 (${untrimmedline.csSiteSpecificFactor15}) must = 988 or 999')
        
        return true

    }

    // ID: NCFD-00710; TAG: 3140; NAME: Laterality, Primary Site (Subm)
    public boolean ncfd00710(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if ((functions.GEN_INLIST(untrimmedline.primarySite, "079,080,081,098,099,301,310,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "341-349,384,400-403,441-443,445-447,471", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "472,491,492,500-509,569,570,620-629,630", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "631,649,659,669,690-699,740-749,754", "(C\\d\\d\\d)", 2, 3))) {
            if (functions.GEN_INLIST(untrimmedline.laterality, "0"))
                return false
            else
                return true
        }
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "090,091", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_AT(untrimmedline.laterality, "0") != 0)
                    return false
                else
                    return true
            }
        }
        if (dx_year > 2003) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "700,710-714,722-725", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.laterality, "0"))
                    return false
                else
                    return true
            }
        }
        if (dx_year >= 2021) {
            if (functions.GEN_AT(untrimmedline.primarySite, "C444") != 0) {
                if (functions.GEN_AT(untrimmedline.laterality, "0") != 0)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Laterality must not = 0 for Primary Site: ${untrimmedline.primarySite} for Date of Diagnosis >= 2021')
                else
                    return true
            }
        }
        return true

    }

    // ID: NCFD-00711; TAG: N0628; NAME: Race 1, Race 2, Race 3, Race 4, Race 5 (SEER IF93)
    public boolean ncfd00711(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: NCFD-00712; TAG: N0410; NAME: Race 3 (NAACCR)
    public boolean ncfd00712(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: NCFD-00713; TAG: N0414; NAME: Race 3, Date of DX (SEER IF90)
    public boolean ncfd00713(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_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: NCFD-00714; TAG: N0411; NAME: Race 4 (NAACCR)
    public boolean ncfd00714(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: NCFD-00715; TAG: N0415; NAME: Race 4, Date of DX (SEER IF91)
    public boolean ncfd00715(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_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: NCFD-00716; TAG: N0412; NAME: Race 5 (NAACCR)
    public boolean ncfd00716(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: NCFD-00717; TAG: N0416; NAME: Race 5, Date of DX (SEER IF92)
    public boolean ncfd00717(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_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: NCFD-00741; TAG: N5016; NAME: RX Summ--Surg Prim Site, Primary Site, 2018 (SEER)
    public boolean ncfd00741(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Grpcode = new char[3], Schema = new char[6], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[10]
        char[] Schema_SITE = new char[15]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "99") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "98") != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (dx_year >= 2018 && dx_year <= 2021) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 760-768, 809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9727, 9732, 9741-9742, 9749, 9761-9809,         9820, 9826, 9831-9834, 9840-9993"))
                    return true
            }
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_SCHEMASURG19, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_SCHEMASURG19_SITELOW, untrimmedline.primarySite, ['GRPCODE':Grpcode, 'SCHEMA':Schema, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Grpcode)
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Primary Site is invalid code')
        }
        if (functions.GEN_AT(Sitegrp, "30") != 0 && functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "41") != 0) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        functions.GEN_STRCAT(Sitegrp, untrimmedline.rxSummSurgPrimSite)
        
        if (dx_year >= 2018 && dx_year <= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_SURG03, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_SURG03_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite} conflicts with Primary Site: ${untrimmedline.primarySite}')
        }
        if (dx_year >= 2022) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_SURG22, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_SURG22_GROUPCODE, Sitegrp, [:]))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among RX Summ--Surg Prim Site: ${untrimmedline.rxSummSurgPrimSite}, Primary Site: ${untrimmedline.primarySite}, and Date of Diagnosis: ${untrimmedline.dateOfDiagnosis.formatDate()}')
        }
        return true

    }

    // ID: NCFD-00746; TAG: N5000; NAME: Behavior Code ICDO3, Summary Stage 2018, Schema ID (NAACCR)
    public boolean ncfd00746(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) != 0) {
                if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") == 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "8") != 0) {
                if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "01", 1) == 0)
                    return false
            }
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0") == 0)
                return false
        }
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "3") != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "08", 1) != 0)
                return false
        }
        return true

    }

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

    }

    // ID: NCFD-00775; TAG: 3174; NAME: Date Initial RX SEER (Subm-NAACCR)
    public boolean ncfd00775(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateInitialRxSeer))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateInitialRxSeer))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Initial RX--SEER: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00777; TAG: 3170; NAME: SSDI for Brain, CNS, Blank for Other Schemas (Subm)
    public boolean ncfd00777(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00721 00722 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Brain,CNS, Brain Molecular Markers must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00778; TAG: 3194; NAME: Reason for No Surgery (Subm-NAACCR)
    public boolean ncfd00778(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery))
            return true
        return functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "0,1,2,5,6,7,8,9")

    }

    // ID: NCFD-00781; TAG: 3197; NAME: PhI Radiation Treatment Modality (Subm)
    public boolean ncfd00781(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00-16,98,99", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NCFD-00784; TAG: 3200; NAME: Rad--Regional RX Modality (Subm-NAACCR)
    public boolean ncfd00784(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (dx_year >= 2010 && dx_year <= 2014 && !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
            return true
        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: NCFD-00785; TAG: 3201; NAME: RX Summ--Transplnt/Endocr (Subm-NAACCR)
    public boolean ncfd00785(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        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: NCFD-00786; TAG: 3175; NAME: CS Tumor Size, Site, Histol ICDO3 (Subm)
    public boolean ncfd00786(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSize))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSize, "998")) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8220,8221"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8220,8221")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "998"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "IllDefinedOther")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "999"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site of ${untrimmedline.primarySite}, CS Tumor Size must = 999')
                }
            }
        }
        return true

    }

    // ID: NCFD-00787; TAG: 3239; NAME: RX Summ--Hormone, Vital Status (Subm)
    public boolean ncfd00787(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_VAL(untrimmedline.rxSummHormone) == 85 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NCFD-00788; TAG: 3176; NAME: RX Summ--Scope Reg LN Sur (Subm-NAACCR)
    public boolean ncfd00788(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0-7,9"))
            return true
        return false

    }

    // ID: NCFD-00789; TAG: 3177; NAME: RX Summ--Surg Oth Reg/Dis (Subm-NAACCR)
    public boolean ncfd00789(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0-5,9"))
            return true
        return false

    }

    // ID: NCFD-00790; TAG: 3178; NAME: RX Date Surgery, Date Last Contact (Subm)
    public boolean ncfd00790(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp, dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery 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: NCFD-00791; TAG: 3179; NAME: RX Summ--Surg Prim Site, Diag Conf (Subm-NAACCR)
    public boolean ncfd00791(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        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: NCFD-00792; TAG: 3171; NAME: SSDI for Breast, Blank for Other Schemas (Subm)
    public boolean ncfd00792(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId) || functions.GEN_AT(untrimmedline.schemaId, "00480") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00480") == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Estrogen Receptor Summary must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, Progesterone Receptor Summary must be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_AT(untrimmedline.schemaId, "00161001690017000480", 5) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Breast, HER2 Overall Summary must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00795; TAG: 3206; NAME: RX Date Chemo (Subm-NAACCR)
    public boolean ncfd00795(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateChemo))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Chemo: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00798; TAG: 3172; NAME: RX Date Hormone (Subm-NAACCR)
    public boolean ncfd00798(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateHormone))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Hormone: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00804; TAG: 3185; NAME: RX Date Radiation (Subm-NAACCR)
    public boolean ncfd00804(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiation))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00806; TAG: 3237; NAME: RX Summ--Hormone (Subm)
    public boolean ncfd00806(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        return functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,01,82,85-88,99", "(\\d\\d)")

    }

    // ID: NCFD-00808; TAG: 3213; NAME: RX Date Mst Defn Srg (Subm)
    public boolean ncfd00808(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00811; TAG: 3229; NAME: RX Date BRM, Date Last Contact (Subm-NAACCR)
    public boolean ncfd00811(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateBrm)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date BRM 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: NCFD-00812; TAG: 3230; NAME: RX Date Surgery, Date of Diagnosis (Subm)
    public boolean ncfd00812(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00813; TAG: 3227; NAME: RX Date Surgery (Subm)
    public boolean ncfd00813(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00814; TAG: 3231; NAME: RX Summ--BRM (Subm)
    public boolean ncfd00814(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        return functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,82,85-88,99", "(\\d\\d)")

    }

    // ID: NCFD-00815; TAG: 3228; NAME: RX Date Hormone, Date Last Contact (Subm-NAACCR)
    public boolean ncfd00815(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateHormone)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Hormone 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: NCFD-00817; TAG: 3202; NAME: RX Date Other, Date Last Contact (Subm-NAACCR)
    public boolean ncfd00817(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateOther))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateOther)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Other 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: NCFD-00818; TAG: 3233; NAME: RX Summ--BRM, Vital Status (Subm)
    public boolean ncfd00818(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_VAL(untrimmedline.rxSummBrm) == 85 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NCFD-00820; TAG: 3234; NAME: RX Summ--Chemo (Subm)
    public boolean ncfd00820(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        functions.GEN_NOOP()
        
        return functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,82,85-88,99", "(\\d\\d)")

    }

    // ID: NCFD-00827; TAG: 3240; NAME: RX Summ--Other (Subm)
    public boolean ncfd00827(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        return functions.GEN_INLIST(untrimmedline.rxSummOther, "0-3,6-9")

    }

    // ID: NCFD-00828; TAG: 3236; NAME: RX Summ--Chemo, Vital Status (Subm)
    public boolean ncfd00828(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_VAL(untrimmedline.rxSummChemo) == 85 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NCFD-00829; TAG: 3223; NAME: Reason for No Radiation (Subm-NAACCR)
    public boolean ncfd00829(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.reasonForNoRadiation))
            return true
        if (functions.GEN_INLIST(untrimmedline.reasonForNoRadiation, "0-2,5-9"))
            return true
        return false

    }

    // ID: NCFD-00834; TAG: 3183; NAME: RX Date Mst Defn Srg, Date of DX (Subm-NAACCR)
    public boolean ncfd00834(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg))
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg is invalid: %DC')
            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: NCFD-00837; TAG: 3181; NAME: Surgery, Rad, Surg/Rad Seq (Subm-NAACCR)
    public boolean ncfd00837(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010 || dx_year > 2017)
            return true
        if (dx_year >= 2010 && dx_year <= 2014 && !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
            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 > 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_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 > 2011))) && 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: NCFD-00840; TAG: 3187; NAME: Systemic RX, Surgery, Systemic/Sur Seq (Subm)
    public boolean ncfd00840(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        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 (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                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: NCFD-00841; TAG: 3188; NAME: RX Summ--Scope Reg LN Sur, Site, ICDO3 (Subm-NAACCR)
    public boolean ncfd00841(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year > 2017 || dx_year < 2001)
            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", "(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", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "760-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        if (dx_year == 2018) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "761-768,809", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C760") != 0)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NCFD-00845; TAG: 3192; NAME: RX Summ--Transplnt/Endocr, Vital Status (Subm-NAACCR)
    public boolean ncfd00845(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_VAL(untrimmedline.rxSummTransplntEndocr) == 85 && functions.GEN_VAL(untrimmedline.vitalStatus) == 1)
            return false
        return true

    }

    // ID: NCFD-00846; TAG: 4020; NAME: ICD Revision Number, Cause of Death (Subm)
    public boolean ncfd00846(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int cod_num
        char[] COD = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.icdRevisionNumber) || functions.GEN_EMPTY(untrimmedline.causeOfDeath)) {
            return true
        }
        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\d)")) {
            cod_num = functions.GEN_VAL(untrimmedline.causeOfDeath)
            if (cod_num == 0) {
                if (!functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                    return false
                else
                    return true
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0"))
                    return false
                else {
                    if (cod_num == 7777 || cod_num == 7797)
                        return true
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "0")) {
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "1")) {
            if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\s)")) {
                functions.GEN_STRCPY(COD, functions.GEN_SUBSTR(untrimmedline.causeOfDeath, 1, 3))
                functions.GEN_STRCAT(COD, "9")
            }
            if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\d)"))
                functions.GEN_STRCPY(COD, untrimmedline.causeOfDeath)
            if (!functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_ICD10COD, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_ICD10COD_CODE, COD, [:]))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "7")) {
                if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.NCFD_ICD7COD, context.NCFD_ICD7COD_CODE, [:]))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "8")) {
                    if (!functions.GEN_ILOOKUP(untrimmedline.causeOfDeath, context.NCFD_ICD8COD, context.NCFD_ICD8COD_CODE, [:]))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.icdRevisionNumber, "9")) {
                        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\s)")) {
                            functions.GEN_STRCPY(COD, functions.GEN_SUBSTR(untrimmedline.causeOfDeath, 1, 3))
                            functions.GEN_STRCAT(COD, "9")
                        }
                        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\d)"))
                            functions.GEN_STRCPY(COD, untrimmedline.causeOfDeath)
                        if (!functions.GEN_ILOOKUP(COD, context.NCFD_ICD9COD, context.NCFD_ICD9COD_CODE, [:]))
                            return false
                    }
                }
            }
        }
        return true

    }

    // ID: NCFD-00847; TAG: 4021; NAME: Summary Stage 2018 (Subm)
    public boolean ncfd00847(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "01234789", 1) != 0)
            return true
        return false

    }

    // ID: NCFD-00848; TAG: 4015; NAME: Follow-Up Source (Subm)
    public boolean ncfd00848(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year >= 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.followUpSource))
            return true
        return functions.GEN_INLIST(untrimmedline.followUpSource, "0-5,7-9")

    }

    // ID: NCFD-00849; TAG: 4013; NAME: Casefinding Source (Subm)
    public boolean ncfd00849(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.casefindingSource))
            return true
        return functions.GEN_INLIST(untrimmedline.casefindingSource, "10,20-30,40,50,60,70,75,80,85,90,95,99", "(\\d\\d)")

    }

    // ID: NCFD-00850; TAG: 4014; NAME: EOD--Tumor Size (Subm)
    public boolean ncfd00850(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 1998 || dx_year > 2003)
            return true
        if (functions.GEN_EMPTY(untrimmedline.eodTumorSize))
            return true
        return functions.GEN_MATCH(untrimmedline.eodTumorSize, "(\\d\\d\\d)")

    }

    // ID: NCFD-00851; TAG: 4017; NAME: Grade Clinical (Subm)
    public boolean ncfd00851(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical))
            return true
        if (functions.GEN_AT(untrimmedline.gradeClinical, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: NCFD-00852; TAG: 4033; NAME: Date 1st Crs RX COC, Date of Last Contact (COC)
    public boolean ncfd00852(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.date1stCrsRxCoc))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastContact, untrimmedline.date1stCrsRxCoc, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            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 (!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: NCFD-00853; TAG: 4016; NAME: Derived Summary Stage 2018 (Subm)
    public boolean ncfd00853(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.derivedSummaryStage2018, "01234789", 1) != 0)
            return true
        return false

    }

    // ID: NCFD-00854; TAG: 4012; NAME: Grade (Subm)
    public boolean ncfd00854(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year >= 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.grade))
            return true
        if (functions.GEN_INLIST(untrimmedline.grade, "1-9"))
            return true
        return false

    }

    // ID: NCFD-00855; TAG: N2500; NAME: AJCC TNM Clin M (COC)
    public boolean ncfd00855(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CLINM = new char[16], METS = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinM))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCMED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCMED9_METS, functions.GEN_TRIM(untrimmedline.ajccTnmClinM, ((Integer)context.NCFD_GEN_RIGHT)), ['METS':METS]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCCLINMED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCCLINMED8_CLINM, functions.GEN_TRIM(untrimmedline.ajccTnmClinM, ((Integer)context.NCFD_GEN_RIGHT)), ['CLINM':CLINM]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00856; TAG: N2502; NAME: AJCC TNM Clin N (COC)
    public boolean ncfd00856(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CLINN = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinN))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCCLINNED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCCLINNED9_CLINN, functions.GEN_TRIM(untrimmedline.ajccTnmClinN, ((Integer)context.NCFD_GEN_RIGHT)), ['CLINN':CLINN]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCCLINNED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCCLINNED8_CLINN, functions.GEN_TRIM(untrimmedline.ajccTnmClinN, ((Integer)context.NCFD_GEN_RIGHT)), ['CLINN':CLINN]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00857; TAG: N2617; NAME: AJCC TNM Clin N Suffix (COC)
    public boolean ncfd00857(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(cnsuff, " ")
        functions.GEN_STRCAT(cnsuff, functions.GEN_TRIM(untrimmedline.ajccTnmClinNSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(cnsuff, " (sn)") != 0 || functions.GEN_AT(cnsuff, " (f)") != 0)
            return true
        else
            return false
        return true

    }

    // ID: NCFD-00858; TAG: N2590; NAME: AJCC TNM Clin Stage Group (COC)
    public boolean ncfd00858(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CLINSTAGE = new char[16], STAGE = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinStageGroup))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCSTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCSTED9_STAGE, functions.GEN_TRIM(untrimmedline.ajccTnmClinStageGroup, ((Integer)context.NCFD_GEN_RIGHT)), ['STAGE':STAGE]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCCLINSTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCCLINSTED8_CLINSTAGE, functions.GEN_TRIM(untrimmedline.ajccTnmClinStageGroup, ((Integer)context.NCFD_GEN_RIGHT)), ['CLINSTAGE':CLINSTAGE]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00859; TAG: N2504; NAME: AJCC TNM Clin T (COC)
    public boolean ncfd00859(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] CLINT = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinT))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCCLINTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCCLINTED9_CLINT, functions.GEN_TRIM(untrimmedline.ajccTnmClinT, ((Integer)context.NCFD_GEN_RIGHT)), ['CLINT':CLINT]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCCLINTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCCLINTED8_CLINT, functions.GEN_TRIM(untrimmedline.ajccTnmClinT, ((Integer)context.NCFD_GEN_RIGHT)), ['CLINT':CLINT]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00860; TAG: N2614; NAME: AJCC TNM Clin T Suffix (COC)
    public boolean ncfd00860(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ctsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmClinTSuffix)) {
            return true
        }
        functions.GEN_STRCPY(ctsuff, " ")
        functions.GEN_STRCAT(ctsuff, functions.GEN_TRIM(untrimmedline.ajccTnmClinTSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(ctsuff, " (s) (m)", 4) == 0)
            return false
        return true

    }

    // ID: NCFD-00861; TAG: N2501; NAME: AJCC TNM Path M (COC)
    public boolean ncfd00861(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHM = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathM))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCMED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCMED9_METS, functions.GEN_TRIM(untrimmedline.ajccTnmPathM, ((Integer)context.NCFD_GEN_RIGHT)), [:]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHMED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHMED8_PATHM, functions.GEN_TRIM(untrimmedline.ajccTnmPathM, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHM':PATHM]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00862; TAG: N2503; NAME: AJCC TNM Path N (COC)
    public boolean ncfd00862(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHN = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathN))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHNED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHNED9_PATHN, functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHN':PATHN]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHNED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHNED8_PATHN, functions.GEN_TRIM(untrimmedline.ajccTnmPathN, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHN':PATHN]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00863; TAG: N2618; NAME: AJCC TNM Path N Suffix (COC)
    public boolean ncfd00863(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] pnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(pnsuff, " ")
        functions.GEN_STRCAT(pnsuff, functions.GEN_TRIM(untrimmedline.ajccTnmPathNSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(pnsuff, " (sn)") != 0 || functions.GEN_AT(pnsuff, " (f)") != 0)
            return true
        else
            return false
        return true

    }

    // ID: NCFD-00864; TAG: N2591; NAME: AJCC TNM Path Stage Group (COC)
    public boolean ncfd00864(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHSTAGE = new char[16], STAGE = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathStageGroup))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCSTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCSTED9_STAGE, functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.NCFD_GEN_RIGHT)), ['STAGE':STAGE]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHSTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHSTED8_PATHSTAGE, functions.GEN_TRIM(untrimmedline.ajccTnmPathStageGroup, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHSTAGE':PATHSTAGE]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00865; TAG: N2505; NAME: AJCC TNM Path T (COC)
    public boolean ncfd00865(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHT = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathT))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHTED9_PATHT, functions.GEN_TRIM(untrimmedline.ajccTnmPathT, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHT':PATHT]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHTED8_PATHT, functions.GEN_TRIM(untrimmedline.ajccTnmPathT, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHT':PATHT]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00866; TAG: N2821; NAME: AJCC TNM Path T Suffix (COC)
    public boolean ncfd00866(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ptsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPathTSuffix)) {
            return true
        }
        functions.GEN_STRCPY(ptsuff, " ")
        functions.GEN_STRCAT(ptsuff, functions.GEN_TRIM(untrimmedline.ajccTnmPathTSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(ptsuff, " (s) (m)", 4) == 0)
            return false
        return true

    }

    // ID: NCFD-00867; TAG: N2587; NAME: AJCC TNM Post Therapy Path (yp) M (COC)
    public boolean ncfd00867(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHM = new char[16], METS = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyM))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCMED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCMED9_METS, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyM, ((Integer)context.NCFD_GEN_RIGHT)), ['METS':METS]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHMED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHMED8_PATHM, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyM, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHM':PATHM]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00868; TAG: N2588; NAME: AJCC TNM Post Therapy Path (yp) N (COC)
    public boolean ncfd00868(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] YPATHN = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyN))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYPATHNED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYPATHNED9_YPATHN, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyN, ((Integer)context.NCFD_GEN_RIGHT)), ['YPATHN':YPATHN]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYPATHNED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYPATHNED8_YPATHN, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyN, ((Integer)context.NCFD_GEN_RIGHT)), ['YPATHN':YPATHN]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00869; TAG: N2619; NAME: AJCC TNM Post Therapy Path (yp) N Suffix (COC)
    public boolean ncfd00869(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ypnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(ypnsuff, " ")
        functions.GEN_STRCAT(ypnsuff, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyNSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(ypnsuff, " (sn)") != 0 || functions.GEN_AT(ypnsuff, " (f)") != 0)
            return true
        else
            return false
        return true

    }

    // ID: NCFD-00870; TAG: N2592; NAME: AJCC TNM Post Therapy Path (yp) Stage Group (COC)
    public boolean ncfd00870(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHSTAGE = new char[100], STAGE = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyStageGroup))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCSTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCSTED9_STAGE, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyStageGroup, ((Integer)context.NCFD_GEN_RIGHT)), ['STAGE':STAGE]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPOSTPATHSTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPOSTPATHSTED8_POSTPATHSTAGE, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyStageGroup, ((Integer)context.NCFD_GEN_RIGHT)), [:]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00871; TAG: N2589; NAME: AJCC TNM Post Therapy Path (yp) T (COC)
    public boolean ncfd00871(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] YPATHT = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyT))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYPATHTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYPATHTED9_YPATHT, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.NCFD_GEN_RIGHT)), ['YPATHT':YPATHT]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYPATHTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYPATHTED8_YPATHT, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyT, ((Integer)context.NCFD_GEN_RIGHT)), ['YPATHT':YPATHT]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00872; TAG: N2616; NAME: AJCC TNM Post Therapy Path (yp) T Suffix (COC)
    public boolean ncfd00872(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] yptsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyTSuffix)) {
            return true
        }
        functions.GEN_STRCPY(yptsuff, " ")
        functions.GEN_STRCAT(yptsuff, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyTSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(yptsuff, " (s) (m)", 4) == 0)
            return false
        return true

    }

    // ID: NCFD-00873; TAG: N2818; NAME: TNM Edition Number (NAACCR)
    public boolean ncfd00873(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "0001020304050607088899", 2) == 0)
            return false
        return true

    }

    // ID: NCFD-00874; TAG: 4032; NAME: Summary Stage 1977, Date of Diagnosis (Subm)
    public boolean ncfd00874(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.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
                return false
        }
        return true

    }

    // ID: NCFD-00875; TAG: 4031; NAME: Summary Stage 2000, Date of Diagnosis (Subm)
    public boolean ncfd00875(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_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')
        }
        return true

    }

    // ID: NCFD-00876; TAG: 4022; NAME: Summary Stage 2018, Derived Summary Stage 2018 (Subm)
    public boolean ncfd00876(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018) && functions.GEN_EMPTY(untrimmedline.derivedSummaryStage2018))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'Summary Stage 2018 or Derived Summary Stage 2018 must be reported for Date of Diagnosis 2018+')
        return true

    }

    // ID: NCFD-00877; TAG: N3973; NAME: TNM Edition Number, Date of Diagnosis (CCCR)
    public boolean ncfd00877(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tnmEditionNumber))
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccId))
            return true
        if (dx_year > 2017 && functions.GEN_AT(untrimmedline.ajccId, "20  36  48.148.258  ", 4) != 0) {
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "000888", 2) == 0)
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2018+, then TNM Edition Number must = 00, 08, or 88')
        }
        return true

    }

    // ID: NCFD-00878; TAG: N3087; NAME: Grade, Ovary/PPC/FT, Behavior ICD-O-3 (NAACCR)
    public boolean ncfd00878(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        char[] ID = new char[20]
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018) {
            return true
        }
        functions.GEN_STRCPY(ID, "00551 00552 00553 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "23", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.gradeClinical, "B", 1) != 0 && functions.GEN_AT(untrimmedline.gradePathological, "B", 1) != 0)
                return false
        }
        return true

    }

    // ID: NCFD-00879; TAG: N2851; NAME: RUCA 2000 (NAACCR)
    public boolean ncfd00879(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ruca2000))
            return true
        if (functions.GEN_AT(untrimmedline.ruca2000, "129ABCD", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00880; TAG: N2852; NAME: RUCA 2010 (NAACCR)
    public boolean ncfd00880(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ruca2010))
            return true
        if (functions.GEN_AT(untrimmedline.ruca2010, "129ABCD", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00881; TAG: N6326; NAME: AJCC TNM Post Therapy Clin (yc) M (COC)
    public boolean ncfd00881(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] PATHM = new char[16], METS = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinM))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCMED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCMED9_METS, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinM, ((Integer)context.NCFD_GEN_RIGHT)), ['METS':METS]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCPATHMED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCPATHMED8_PATHM, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinM, ((Integer)context.NCFD_GEN_RIGHT)), ['PATHM':PATHM]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00882; TAG: N6327; NAME: AJCC TNM Post Therapy Clin (yc) N (COC)
    public boolean ncfd00882(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] YCLINN = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinN))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYCLINNED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYCLINNED9_YCLINN, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinN, ((Integer)context.NCFD_GEN_RIGHT)), ['YCLINN':YCLINN]))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYCLINNED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYCLINNED8_YCLINN, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinN, ((Integer)context.NCFD_GEN_RIGHT)), ['YCLINN':YCLINN]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00883; TAG: N6328; NAME: AJCC TNM Post Therapy Clin (yc) N Suffix (COC)
    public boolean ncfd00883(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] ycnsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinNSuffix)) {
            return true
        }
        functions.GEN_STRCPY(ycnsuff, " ")
        functions.GEN_STRCAT(ycnsuff, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinNSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(ycnsuff, " (sn)") != 0 || functions.GEN_AT(ycnsuff, " (f)") != 0)
            return true
        else
            return false
        return true

    }

    // ID: NCFD-00884; TAG: N6330; NAME: AJCC TNM Post Therapy Clin (yc) Stage Group (COC)
    public boolean ncfd00884(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinStageGrp))
            return false
        
        return true

    }

    // ID: NCFD-00885; TAG: N6323; NAME: AJCC TNM Post Therapy Clin (yc) T (COC)
    public boolean ncfd00885(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] YCLINT = new char[16]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinT))
            return true
        if (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.ajccId, ((Integer)context.NCFD_GEN_RIGHT)), "52") != 0 && dx_year >= 2021) {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYCLINTED9, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYCLINTED9_YCLINT, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinT, ((Integer)context.NCFD_GEN_RIGHT)), ['YCLINT':YCLINT]))
                return true
        }
        else {
            if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NCFD_COCYCLINTED8, (com.imsweb.validation.entities.ContextTableIndex)context.NCFD_COCYCLINTED8_YCLINT, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinT, ((Integer)context.NCFD_GEN_RIGHT)), ['YCLINT':YCLINT]))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00886; TAG: N6324; NAME: AJCC TNM Post Therapy Clin (yc) T Suffix (COC)
    public boolean ncfd00886(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] yCtsuff = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.ajccTnmPostTherapyClinTSuffix)) {
            return true
        }
        functions.GEN_STRCPY(yCtsuff, " ")
        functions.GEN_STRCAT(yCtsuff, functions.GEN_TRIM(untrimmedline.ajccTnmPostTherapyClinTSuffix, ((Integer)context.NCFD_GEN_RIGHT)))
        
        if (functions.GEN_AT(yCtsuff, " (s) (m)", 4) == 0)
            return false
        return true

    }

    // ID: NCFD-00889; TAG: N6569; NAME: Regional Nodes Positive Regional Nodes Examined (NAACCR)
    public boolean ncfd00889(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2018)
            return true
        ex = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        pos = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        
        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: NCFD-00892; TAG: N1375; NAME: Census Tract 2010 (SEER)
    public boolean ncfd00892(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2010))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusTract2010, "000000, 000100-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return false
        return true

    }

    // ID: NCFD-00893; TAG: 4030; NAME: Surgery, Phase I Rad, Surg/Rad Seq (Subm)
    public boolean ncfd00893(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            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", "(\\d\\d)") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "3-7") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98", "(\\d\\d)") && dx_year >= 2018 && dx_year <= 2020) || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "2") && dx_year >= 2021)) || functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5")) && functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2-7,9"))
                return true
            else
                return false
        }
        else {
            if ((functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,99", "(\\d\\d)") && (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") || (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "1") && dx_year >= 2021)) && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) || functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99", "(\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0"))
                    return true
                else
                    return false
            }
            else
                return true
        }
        return true

    }

    // ID: NCFD-00895; TAG: 4034; NAME: Date Initial RX SEER, Date Last Cont (NAACCR IF35)
    public boolean ncfd00895(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.dateInitialRxSeer))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateInitialRxSeer, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            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 (!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: NCFD-00896; TAG: 4035; NAME: RX Summ--Transplnt/Endocr, Primary Site (Subm)
    public boolean ncfd00896(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.NCFD_GEN_DT_ERROR) || dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year < 2010)
            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: NCFD-00897; TAG: 4018; NAME: Grade Pathological (Subm)
    public boolean ncfd00897(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_AT(untrimmedline.gradePathological, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: NCFD-00898; TAG: 4019; NAME: Grade Post Therapy Path (yp) (Subm)
    public boolean ncfd00898(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapy, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: NCFD-00900; TAG: 8001; NAME: Date 1st Crs RX COC (Subm-NAACCR)
    public boolean ncfd00900(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2006)
            return true
        if (functions.GEN_EMPTY(untrimmedline.date1stCrsRxCoc))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.date1stCrsRxCoc))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00901; TAG: 8013; NAME: Date 1st Crs RX COC, Date of Diagnosis (Subm-NAACCR)
    public boolean ncfd00901(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2006)
            return true
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.date1stCrsRxCoc) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.date1stCrsRxCoc, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.date1stCrsRxCoc))
                functions.GEN_ERROR_TEXT(binding, 'Date of 1st Crs RX--COC is invalid: %DC')
            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: NCFD-00902; TAG: 8018; NAME: CS Site-Specific Factor 1, Schema (Subm)
    public boolean ncfd00902(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Pleura,Breast,Lung,Brain,CNSOther,IntracranialGland,Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor1)
        
        t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 10, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00903; TAG: 8019; NAME: CS Site-Specific Factor 2, Schema (Subm)
    public boolean ncfd00903(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor2)
        
        t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 11, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00904; TAG: 8020; NAME: CS Site-Specific Factor 8, Schema (Subm)
    public boolean ncfd00904(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            return true
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor8)
        
        t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 17, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00905; TAG: 8023; NAME: Date Initial RX SEER, Date of DX (Subm)
    public boolean ncfd00905(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year, dx_month, dx_day, seer_year, seer_month, seer_day
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2006)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.dateInitialRxSeer) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDiagnosis))
            return true
        if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateInitialRxSeer))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfDiagnosis, untrimmedline.dateInitialRxSeer, ((Integer)context.NCFD_GEN_DT_EXACT))
        
        if (dtcmp <= 0)
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
        dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
        seer_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateInitialRxSeer)
        seer_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateInitialRxSeer)
        seer_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateInitialRxSeer)
        
        if (dx_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY) || seer_month == ((Integer)context.NCFD_GEN_DT_MONTH_EMPTY)) {
            if (dx_year <= seer_year)
                return true
            else
                return false
        }
        else {
            if (dx_day == ((Integer)context.NCFD_GEN_DT_DAY_EMPTY) || seer_day == ((Integer)context.NCFD_GEN_DT_DAY_EMPTY)) {
                if (dx_year < seer_year)
                    return true
                else {
                    if (dx_year == seer_year && dx_month <= seer_month)
                        return true
                    else
                        return false
                }
            }
            else
                return false
        }
        return false

    }

    // ID: NCFD-00906; TAG: 8014; NAME: CS Over-ride CS 20, Rpt Srce, CS Fields (Subm-NAACCR)
    public boolean ncfd00906(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"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csExtension) || !functions.GEN_EMPTY(untrimmedline.csTumorSize) || !functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || !functions.GEN_EMPTY(untrimmedline.csLymphNodes) || !functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || !functions.GEN_EMPTY(untrimmedline.csMetsAtDx) || !functions.GEN_EMPTY(untrimmedline.csMetsEval) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
        
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Site-Specific Factor25 cannot be left blank')
        }
        
        return true

    }

    // ID: NCFD-00907; TAG: 8024; NAME: Regional Nodes Ex, Reg Nodes Pos (Subm)
    public boolean ncfd00907(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year > 2017)
            return true
        if (dx_year < 2012) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "180-209", "(C\\d\\d\\d)", 2, 3))
                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) || (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: NCFD-00908; TAG: 8012; NAME: RX Summ--Radiation (Subm)
    public boolean ncfd00908(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-5,7-9")

    }

    // ID: NCFD-00909; TAG: 8008; NAME: RX Summ--Surg Prim Site (Subm-NAACCR)
    public boolean ncfd00909(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,10-90, 98, 99"))
            return true
        return false

    }

    // ID: NCFD-00910; TAG: 8002; NAME: RX Date BRM (Subm-NAACCR)
    public boolean ncfd00910(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateBrm))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date BRM: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00911; TAG: 8015; NAME: RX Date Other (Subm-NAACCR)
    public boolean ncfd00911(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateOther))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Other: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00912; TAG: 8009; NAME: RX Date BRM, Date of Diagnosis (Subm-NAACCR)
    public boolean ncfd00912(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00913; TAG: 8007; NAME: RX Date Chemo, Date Last Contact (Subm-NAACCR)
    public boolean ncfd00913(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateChemo)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Chemo 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: NCFD-00914; TAG: 8004; NAME: RX Date Chemo, Date of Diagnosis (Subm-NAACCR)
    public boolean ncfd00914(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00915; TAG: 8005; NAME: RX Date Hormone, Date of Diagnosis (Subm-NAACCR)
    public boolean ncfd00915(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00916; TAG: 8010; NAME: RX Date Other, Date of Diagnosis (Subm-NAACCR)
    public boolean ncfd00916(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00917; TAG: 8011; NAME: RX Date Radiation, Date Last Contact (Subm-NAACCR)
    public boolean ncfd00917(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiation)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation 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: NCFD-00918; TAG: 8006; NAME: RX Date Radiation, Date of Diagnosis (Subm-NAACCR)
    public boolean ncfd00918(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOfDiagnosis, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00919; TAG: 8021; NAME: CS Site-Specific Factor10, Schema (Subm)
    public boolean ncfd00919(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            return true
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor10)
        
        t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 19, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00920; TAG: 8022; NAME: CS Site-Specific Factor15, Schema (Subm)
    public boolean ncfd00920(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csSiteSpecificFactor15)
        
        t_result = functions.GEN_EXTERNALDLL("CStage0205.dll", "CStage_code_is_valid", t_schema_number, 24, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NCFD-00921; TAG: N2021; NAME: Primary Site, Heme Morph, DateDX, NoOverride (SEER)
    public boolean ncfd00921(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.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9823") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "420,421,424", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed prior to 2010, 9823 is valid only for C420, C421, C424')
            }
        }
        if (dx_year >= 2010) {
        
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732,9741,9742,9800,9801,9806-9809,9819-9820,9826,9831-9834,9840") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9860,9861,9863,9865-9867,9869-9879,9891,9895-9898,9910-9912,9920,9931,9940") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9945,9946,9948,9950,9961-9968,9975,9980,9982,9983,9985,9986,9989,9991-9993")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "421", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C421')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590,9591,9596,9597,9650-9653,9655,9659,9663,9671,9673,9678,9680,9687,9688,9690") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9691,9695,9698,9700-9702,9705,9708,9709,9712,9714,9717-9719,9724-9727") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9735,9737,9738,9740,9751,9755-9759,9762,9811-9818,9823,9827,9837,9971")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420,423,424", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3}, Primary Site must not = C420, C423, C424')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9679")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "379,381-383", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C379, C381-C383')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9689")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "422", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C422')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9699")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420,422,423,424", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must not = C420, C422, C423, C424')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9716")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "422", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C422')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "400-419", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C400-C419')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "400-419,420,423,424", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, if Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3}, Primary Site must not=C400-C419, C420, C423, C424')
            }
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9930")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must not = C420, C421, C423, C424')
            }
        }
        if (dx_year > 2009 && dx_year < 2018) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9761")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "420", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010-2017, if Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site must = C420')
            }
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420", "(C\\d\\d\\d)", 2, 3)) {
                if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9761"))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010-2017, if Primary Site=${untrimmedline.primarySite}, Histologic Type ICD-O-3 must = 9761')
            }
        }
        if (dx_year > 2017) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9761")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "421", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2018 and later, 9761 coded to C421, no histology coded to C420')
            }
            if (functions.GEN_INLIST(untrimmedline.primarySite, "420", "(C\\d\\d\\d)", 2, 3))
                return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2018 and later, 9761 coded to C421, no histology coded to C420')
        }
        return true

    }

    // ID: NCFD-00922; TAG: N2022; NAME: Primary Site, Heme Morph, DateDX, Override (SEER)
    public boolean ncfd00922(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.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9993"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteType, "1"))
            return true
        if (dx_year < 2010)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650,9651,9652,9653,9655,9659,9663,9688")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "770-779", "(C\\d\\d\\d)", 2, 3))
                return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3},Primary Site not=C770-C779; review required')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9597,9700,9701,9709,9718,9725")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010 or later, Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3},Primary Site not skin lymphoma; review required')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9708,9726")) {
                    if (!functions.GEN_INLIST(untrimmedline.primarySite, "440-449,490-499,510-512,518-519,600-602,608-609,632", "(C\\d\\d\\d)", 2, 3))
                        return functions.GEN_ERROR_MSG(binding, 'Hemato diag 2010+, Histologic Type ICD-O-3=${untrimmedline.histologicTypeIcdO3},Primary Site not skin or soft tissue lymphoma; review required')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9719")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "050-059,110-119,300-301,310-319", "(C\\d\\d\\d)", 2, 3))
                return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site = ${untrimmedline.primarySite}: review required')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9751")) {
                if (!functions.GEN_INLIST(untrimmedline.primarySite, "340-349,400-419,421,440-449,490-499,770-779", "(C\\d\\d\\d)", 2, 3))
                    return functions.GEN_ERROR_MSG(binding, 'Hemato case diagnosed 2010 or later, Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, Primary Site = ${untrimmedline.primarySite}: review required')
            }
        }
        
        return true

    }

    // ID: NCFD-00923; TAG: N5042; NAME: Breslow Tumor Thickness, Melanoma, Summary Stage 2018 (NAACCR)
    public boolean ncfd00923(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00470") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.breslowTumorThickness) || functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.summaryStage2018, "0", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.9") == 0)
                return false
        }
        return true

    }

    // ID: NCFD-00924; TAG: N6071; NAME: Date of Diagnosis, Required (NAACCR)
    public boolean ncfd00924(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return false
        return true

    }

    // ID: NCFD-00925; TAG: N6744; NAME: Date of Last Contact, Required (NPCR)
    public boolean ncfd00925(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") != 0) {
            if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
                return false
        }
        return true

    }

    // ID: NCFD-00926; TAG: 8035; NAME: Tumor Size 998, Schema ID (Subm)
    public boolean ncfd00926(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[100]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(ID, "00161 00169 00170 00200 00290 00330 00360 00370 00400 00410 00421 00430 00450 00470 00480 00459 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) == 0) {
            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "998") != 0)
                return false
        }
        return true

    }

    // ID: NCFD-00927; TAG: N6638; NAME: Tumor Size 999, Schema ID, Primary Site (NAACCR)
    public boolean ncfd00927(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        char[] ID = new char[90]
        char[] code = new char[6]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_AT(untrimmedline.primarySite, "C422")) {
            return true
        }
        functions.GEN_STRCPY(ID, "00458 00671 00672 00790 00795 00821 00822 00830 ") /* add blank to coded Schema ID to match edit string*/
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.tumorSizeSummary, "999") == 0 && !functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
                return false
        }
        return true

    }

    // ID: NCFD-00928; TAG: N2575; NAME: Census Tract 2020 (NAACCR)
    public boolean ncfd00928(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2020))
            return true
        return functions.GEN_INLIST(untrimmedline.censusTract2020, "000000,000100-999999", "(\\d\\d\\d\\d\\d\\d)")

    }

    // ID: NCFD-00929; TAG: N2062; NAME: County at DX Geocode2020 (NAACCR)
    public boolean ncfd00929(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.countyAtDxGeocode2020))
            return true
        return functions.GEN_INLIST(untrimmedline.countyAtDxGeocode2020, "001-999", "(\\d\\d\\d)")

    }

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

    }

    // ID: NCFD-00931; TAG: N6332; NAME: Grade Post Therapy Clin (yc) (NAACCR)
    public boolean ncfd00931(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin))
            return true
        if (functions.GEN_AT(untrimmedline.gradePostTherapyClin, "1234589ABCDEHLMS", 1) != 0)
            return true
        return false

    }

    // ID: NCFD-00932; TAG: N6608; NAME: Lymphovascular Invasion, Behavior (NAACCR)
    public boolean ncfd00932(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2022)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "012", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "12349", 1) != 0)
                return false
            else
                return true
        }
        return true

    }

    // ID: NCFD-00933; TAG: 8037; NAME: Grade Path, Grade Post Therapy (Subm)
    public boolean ncfd00933(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.NCFD_GEN_DT_ERROR) || dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePathological))
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00790007950081100812008210082200830", 5) != 0)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy)) {
            if (functions.GEN_AT(untrimmedline.gradePathological, "9") == 0)
                return false
        }
        return true

    }

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

    }

    // ID: NCFD-00935; TAG: N2572; NAME: State at DX Geocode 2010 (NAACCR)
    public boolean ncfd00935(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.stateAtDxGeocode2010))
            return true
        if (functions.GEN_INLIST(untrimmedline.stateAtDxGeocode2010, "01-95", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NCFD-00936; TAG: N2573; NAME: State at DX Geocode 2020 (NAACCR)
    public boolean ncfd00936(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.stateAtDxGeocode2020))
            return true
        if (functions.GEN_INLIST(untrimmedline.stateAtDxGeocode2020, "01-95", "(\\d\\d)"))
            return true
        return false

    }

    // ID: NCFD-00937; TAG: 3258; NAME: Tumor Size Summary (Subm)
    public boolean ncfd00937(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2016)
            return true
        if (functions.GEN_EMPTY(untrimmedline.tumorSizeSummary))
            return true
        return functions.GEN_INLIST(untrimmedline.tumorSizeSummary, "000-990, 998, 999", "(\\d\\d\\d)")

    }

    // ID: NCFD-00938; TAG: N6889; NAME: IHS Purchased/Referred Care Delivery Area (NAACCR)
    public boolean ncfd00938(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ihsPurchRefCareDeliveryArea))
            return true
        return functions.GEN_INLIST(untrimmedline.ihsPurchRefCareDeliveryArea, "0,1,9")

    }

    // ID: NCFD-00939; TAG: N2845; NAME: Record Number Recode (NAACCR)
    public boolean ncfd00939(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.recordNumberRecode))
            return true
        return functions.GEN_INLIST(untrimmedline.recordNumberRecode, "01-99", "(\\d\\d)")

    }

    // ID: NCFD-00940; TAG: N5060; NAME: Lymphovascular Invasion, Testis, Summary Stage 2018 (NAACCR)
    public boolean ncfd00940(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_AT(untrimmedline.schemaId, "00590") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) || functions.GEN_AT(untrimmedline.lymphVascularInvasion, "8") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "1234", 1) != 0) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "0", 1) != 0)
                return false
        }
        return true

    }

    // ID: NCFD-00941; TAG: 8031; NAME: RX Date Radiation, PhI Radiation Treatment Modality (Subm)
    public boolean ncfd00941(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality))
            return true
        if (functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00,99")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "01-16,98"))
                return false
        }
        return true

    }

    // ID: NCFD-00942; TAG: N5019; NAME: RX Summ--Scope Reg LN Sur, Primary Site, 2018 (NAACCR)
    public boolean ncfd00942(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,589,700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "9") != 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00943; TAG: 3265; NAME: SSDI for Colorectal, CNS, Blank for Other Schemas (Subm)
    public boolean ncfd00943(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        
        char[] code = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId)) {
            return true
        }
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, "00200 ", 6) == 0) {
            if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability)) {
                functions.GEN_SAVE_TEXT(binding, 'If Schema is not Colorectal, Microsatellite Instability (MSI) must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00944; TAG: 8033; NAME: Surgery, RX Date Surgery, ICDO3 (Subm)
    public boolean ncfd00944(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (dx_year == 2018 && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9702-9992"))
            return true
        if (dx_year < 2011 || dx_year > 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        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, "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_EMPTY(untrimmedline.rxDateSurgery))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If surgery fields indicate no treatment, date of surgery must be blank')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery)) {
            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, "1,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"))
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If date of surgery is not blank, at least one surgery field must indicate treatment.')
        }
        return true

    }

    // ID: NCFD-00945; TAG: 8034; NAME: Surgery, RX Date Surgery, Primary Site (NAACCR)
    public boolean ncfd00945(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2019 || dx_year > 2022)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        char[] ID = new char[15]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420, 421, 423, 424, 589,700-729,751-753,761-768,770-779,809", "(C\\d\\d\\d)", 2, 3))
            exception = 1
        else {
            if (dx_year >= 2019 && dx_year <= 2021) {
                if (functions.GEN_AT(code, ID, 6) != 0 || (functions.GEN_AT(untrimmedline.schemaId, "00822") != 0 && functions.GEN_AT(untrimmedline.histologicTypeIcdO3, "9734") == 0) || (functions.GEN_AT(untrimmedline.schemaId, "99999") != 0 && functions.GEN_AT(untrimmedline.primarySite, "C422") == 0))
                    return true
            }
        }
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "0098", 2) != 0 && (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "0") != 0 || (exception == 1 && functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "9") != 0) || (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "1") != 0 && dx_year >= 2021)) && functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "0") != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If surgery fields indicate no treatment, date of surgery must be blank')
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgery)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90") || ((functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "2") != 0 && dx_year >= 2021) || functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "34567", 1) != 0 || (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "2") != 0 && functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "01-98") && dx_year >= 2019 && dx_year <= 2020) || (functions.GEN_AT(untrimmedline.rxSummScopeRegLnSur, "1") != 0 && dx_year < 2021)) || functions.GEN_AT(untrimmedline.rxSummSurgOthRegDis, "12345", 1) != 0)
                return true
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'If date of surgery is not blank, at least one surgery field must indicate treatment.')
        }
        return true

    }

    // ID: NCFD-00946; TAG: 8028; NAME: RX Summ--Chemo, RX Date Chemo (Subm)
    public boolean ncfd00946(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        if (dx_year >= 2011 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-88, 99")) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo))
                return true
            else
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "01,02,03"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00947; TAG: 8029; NAME: RX Summ--Hormone, RX Date Hormone (Subm)
    public boolean ncfd00947(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummHormone))
            return true
        if (dx_year >= 2011 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82,85-88,99")) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone))
                return true
            else
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummHormone, "01"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00948; TAG: 8030; NAME: RX Summ--Other, RX Date Other (Subm
    public boolean ncfd00948(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummOther))
            return true
        if (dx_year >= 2011 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummOther, "0,7,8,9")) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther))
                return true
            else
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummOther, "1-6"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00949; TAG: 8027; NAME: RX Summ--BRM, RX Date BRM (Subm)
    public boolean ncfd00949(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (dx_year >= 2011 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-88, 99")) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm))
                return true
            else
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "01"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00950; TAG: 8032; NAME: RX Date Radiation, Rad--Regional RX Modality (Subm)
    public boolean ncfd00950(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2011 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummRadiation) && functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (dx_year >= 2011 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00, 99")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "20-32,40-43,50-55,60-62,80,85,98") && !functions.GEN_INLIST(untrimmedline.rxSummRadiation, "1,2,3,4,5"))
                return false
        }
        return true

    }

    // ID: NCFD-00951; TAG: 3251; NAME: RX Summ--Surg/Rad Seq (Subm)
    public boolean ncfd00951(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        return functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0,2-7,9")

    }

    // ID: NCFD-00952; TAG: 3252; NAME: RX Summ--Systemic/Sur Seq (Subm)
    public boolean ncfd00952(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq))
            return true
        if (dx_year >= 2010 && dx_year <= 2014) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582") || !functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        return functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0,2-7,9")

    }

    // ID: NCFD-00953; TAG: N2853; NAME: Census Tr Certainty 2020 (NAACCR)
    public boolean ncfd00953(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTrCertainty2010))
            return true
        return functions.GEN_INLIST(untrimmedline.censusTrCertainty2010, "1-6, 9")

    }

    // ID: NCFD-00954; TAG: N3966; NAME: Lymphovascular Invasion (COC)
    public boolean ncfd00954(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.NCFD_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR)) || (dx_year < 2018))
            return true
        if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion))
            return true
        if (functions.GEN_AT(untrimmedline.lymphVascularInvasion, "0123489", 1) == 0)
            return false
        return true

    }

    // ID: NCFD-00955; TAG: N2030; NAME: RX Date Mst Defn Srg, Date Last Contact (NPCR)
    public boolean ncfd00955(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfLastContact, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg 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: NCFD-00956; TAG: N6361; NAME: Grade Post Therapy, Primary Site, Schema ID (NAACCR)
    public boolean ncfd00956(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2021)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_EMPTY(untrimmedline.primarySite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin) && functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            return true
        char[] ID = new char[55]
        char[] code = new char[7]
        
        
        functions.GEN_STRCPY(ID, "00790 00795 00811 00812 00821 00822 00830 99999 ")
        
        
        functions.GEN_STRCPY(code, untrimmedline.schemaId)
        functions.GEN_STRCAT(code, " ")
        
        if (functions.GEN_AT(code, ID, 6) != 0 || functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,809", "(C\\d\\d\\d)", 2, 4)) {
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Clin (yc) must be blank for Primary Site: ${untrimmedline.primarySite} and/or Schema ID: ${untrimmedline.schemaId}')
            if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Grade Post Therapy Path (yp) must be blank for Primary Site: ${untrimmedline.primarySite} and/or Schema ID: ${untrimmedline.schemaId}')
        }
        return true

    }

    // ID: NCFD-00957; TAG: N2031; NAME: RX Date Mst Defn Srg, RX Date Surgery (NPCR)
    public boolean ncfd00957(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.rxDateSurgery, ((Integer)context.NCFD_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NCFD_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgery)) {
                    functions.GEN_ERROR_TEXT(binding, 'RX Date Surgery is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NCFD-00958; TAG: 8036; NAME: RX Date Mst Defn Srg, Surg Prim Site (Subm)
    public boolean ncfd00958(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.NCFD_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NCFD_GEN_DT_ERROR))
            return true
        if (dx_year < 2015 || dx_year > 2022)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "009899", 2) != 0) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
                return true
            else
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-90"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NCFD-00959; TAG: N6104; NAME: Summary Stage 2018, Regional Nodes Positive (NAACCR)
    public boolean ncfd00959(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2019)
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") != 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.summaryStage2018))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97", "(\\d\\d)")) {
            if (functions.GEN_AT(untrimmedline.summaryStage2018, "012", 1) != 0)
                return false
        }
        return true

    }

    // ID: NCFD-00960; TAG: 3256; NAME: RX Summ--Treatment Status (Subm)
    public boolean ncfd00960(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummTreatmentStatus))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummTreatmentStatus, "0-2, 9"))
            return false
        
        return true

    }

    // ID: NCFD-00961; TAG: 8016; NAME: Autopsy Only, RX (Subm)
    public boolean ncfd00961(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001 || dx_year > 2017)
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98", "(\\d\\d)") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Prim Site')
            err_flag = 1
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,9") && !functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
                err_flag = 1
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
                err_flag = 1
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,9") && !functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery)) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Reason for No Surgery')
            err_flag = 1
        }
        if (dx_year >= 2010 && dx_year <= 2014 && (functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582"))) {
        
            if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummBrm)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--BRM')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummChemo)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Chemo')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummHormone)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Hormone')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummOther)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Other')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Transplnt/Endocr')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00") && !functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Rad--Regional RX Modality')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg/Rad Seq')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Systemic/Sur Seq')
                err_flag = 1
            }
        }
        if (dx_year >= 2015 && dx_year <= 2017) {
        
            if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummBrm)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--BRM')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummChemo)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Chemo')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummHormone)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Hormone')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummOther)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Other')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00") && !functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Transplnt/Endocr')
                err_flag = 1
            }
            if (dx_year < 2018) {
                if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00") && !functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Rad--Regional RX Modality')
                    err_flag = 1
                }
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg/Rad Seq')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Systemic/Sur Seq')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

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

    }

    // ID: NCFD-00963; TAG: 8017; NAME: Cancer Items, Type Reporting Source-DCO (Subm)
    public boolean ncfd00963(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_AT(untrimmedline.behaviorCodeIcdO3, "2") != 0)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (functions.GEN_AT(untrimmedline.schemaId, "007210072200723", 5) == 0)
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.diagnosticConfirmation) && functions.GEN_AT(untrimmedline.diagnosticConfirmation, "39", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Diagnostic Confirmation must = 3, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradeClinical) && functions.GEN_AT(untrimmedline.gradeClinical, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Clinical must = 8, 9 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradePathological) && functions.GEN_AT(untrimmedline.gradePathological, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Pathological must = 8, 9 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapyClin))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Post Therapy Clin (yc) must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.gradePostTherapy))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Grade Post Therapy Path (yp) must = blank')
        if (!functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) && functions.GEN_AT(untrimmedline.lymphVascularInvasion, "89", 1) == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Lymphovascular Invasion must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) && functions.GEN_AT(untrimmedline.regionalNodesPositive, "99") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Regional Nodes Positive must = 99 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) && functions.GEN_AT(untrimmedline.regionalNodesExamined, "99") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Regional Nodes Examined must = 99 or blank')
        if (!functions.GEN_EMPTY(untrimmedline.tumorSizeSummary) && functions.GEN_AT(untrimmedline.tumorSizeSummary, "999") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Tumor Size Summary must = 999 or blank')
        if (functions.GEN_AT(untrimmedline.vitalStatus, "0") == 0)
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Vital Status must = 0')
        if (functions.GEN_AT(untrimmedline.icdRevisionNumber, "1789") == 0 && !functions.GEN_EMPTY(untrimmedline.icdRevisionNumber))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: ICD Revision Number must = 1, 7, 8, or 9')
        return true

    }

    // ID: NCFD-00964; TAG: 8026; NAME: Death Certificate Only, RX (Subm)
    public boolean ncfd00964(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int err_flag
        err_flag = 0
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2001)
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99,98", "(\\d\\d)") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Prim Site')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "9") && !functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur)) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Scope Reg LN Sur')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "9") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis)) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Surg Oth Reg/Dis')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "9") && !functions.GEN_EMPTY(untrimmedline.reasonForNoSurgery)) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Reason for No Surgery')
            err_flag = 1
        }
        if (dx_year >= 2010 && dx_year <= 2014 && (functions.GEN_INLIST(untrimmedline.primarySite, "500-509, 180-209", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044, 9060-9136, 9141-9582"))) {
        
            if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummBrm)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--BRM')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummChemo)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Chemo')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummHormone)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Hormone')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "9") && !functions.GEN_EMPTY(untrimmedline.rxSummOther)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Other')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Transplnt/Endocr')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "99") && !functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Rad--Regional RX Modality')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Surg/Rad Seq')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Systemic/Sur Seq')
                err_flag = 1
            }
        }
        if (dx_year >= 2015 && dx_year <= 2017) {
        
            if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummBrm)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--BRM')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummChemo)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Chemo')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummHormone)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Hormone')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "9") && !functions.GEN_EMPTY(untrimmedline.rxSummOther)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Other')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "99") && !functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Transplnt/Endocr')
                err_flag = 1
            }
            if (dx_year < 2018) {
                if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "99") && !functions.GEN_EMPTY(untrimmedline.radRegionalRxModality)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Rad--Regional RX Modality')
                    err_flag = 1
                }
            }
            if (dx_year >= 2018) {
                if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "99") && !functions.GEN_EMPTY(untrimmedline.phase1RadiationTreatmentModality)) {
                    functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & Phase I Radiation Treatment Modality')
                    err_flag = 1
                }
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Surg/Rad Seq')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0") && !functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq)) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Death Certificate Only & RX Summ--Systemic/Sur Seq')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00965; TAG: 8025; NAME: SSDI, DCO (Subm)
    public boolean ncfd00965(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_AT(untrimmedline.typeOfReportingSource, "7") == 0)
            return true
        if (functions.GEN_EMPTY(untrimmedline.schemaId))
            return true
        int dx_year
        int err_flag
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year < 2018)
            return true
        if (!functions.GEN_EMPTY(untrimmedline.brainMolecularMarkers) && functions.GEN_AT(untrimmedline.brainMolecularMarkers, "8899", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Brain Molecular Markers must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.breslowTumorThickness) && functions.GEN_AT(untrimmedline.breslowTumorThickness, "XX.8XX.9", 4) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Breslow Tumor Thickness must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.estrogenReceptorSummary) && functions.GEN_AT(untrimmedline.estrogenReceptorSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Estrogen Receptor Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.fibrosisScore) && functions.GEN_AT(untrimmedline.fibrosisScore, "89", 2) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Fibrosis Score must be blank, unknown, or NA')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.her2OverallSummary) && functions.GEN_AT(untrimmedline.her2OverallSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: HER2 Overall Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.ldhPretreatmentLabValue) && functions.GEN_AT(untrimmedline.ldhPretreatmentLabValue, "XXXXX.8XXXXX.9", 7) == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: LDH Lab Value must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.microsatelliteInstability) && functions.GEN_AT(untrimmedline.microsatelliteInstability, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Microsatellite Instability (MSI) must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.progesteroneRecepSummary) && functions.GEN_AT(untrimmedline.progesteroneRecepSummary, "9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: Progesterone Receptor Summary must be blank or unknown')
            err_flag = 1
        }
        if (!functions.GEN_EMPTY(untrimmedline.psaLabValue) && functions.GEN_AT(untrimmedline.psaLabValue, "XXX.9") == 0) {
            functions.GEN_SAVE_TEXT(binding, 'DCO: PSA (Prostatic Specific Antigen) Lab Value must be blank or unknown')
            err_flag = 1
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NCFD-00966; TAG: N0957; NAME: Date of Death--Canada (CCCR)
    public boolean ncfd00966(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfDeathCanada))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfDeathCanada))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date of Death--Canada: %DC')
            return false
        }
        
        return true

    }

    // ID: NCFD-00967; TAG: N1028; NAME: Date of Death--Canada, Vital Status (NAACCR)
    public boolean ncfd00967(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1")) {
            if (!functions.GEN_EMPTY(untrimmedline.dateOfDeathCanada))
                return false
        }
        if (!functions.GEN_EMPTY(untrimmedline.dateOfDeathCanada)) {
            if (functions.GEN_AT(untrimmedline.vitalStatus, "0") == 0)
                return false
        }
        return true

    }

    // ID: NCFD-00968; TAG: 3152; NAME: Derived SS2000, Behavior ICDO3 (Subm)
    public boolean ncfd00968(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.derivedSs2000))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
            if (functions.GEN_INLIST(untrimmedline.derivedSs2000, "8"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2") && functions.GEN_INLIST(t_schema_name, "Bladder")) {
                if (!functions.GEN_INLIST(untrimmedline.derivedSs2000, "8"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                    if (functions.GEN_INLIST(untrimmedline.derivedSs2000, "0"))
                        return true
                    else {
                        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                        return false
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3") && functions.GEN_INLIST(t_schema_name, "Prostate")) {
                        if (!functions.GEN_INLIST(untrimmedline.derivedSs2000, "8"))
                            return true
                        else {
                            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                            return false
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                            if (!functions.GEN_INLIST(untrimmedline.derivedSs2000, "0,8"))
                                return true
                            else {
                                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                return false
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NCFD-00969; TAG: 3250; NAME: RX Summ--Surg Prim Site, Site, ICDO3 (Subm)
    public boolean ncfd00969(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.NCFD_GEN_DT_EMPTY) || dx_year == ((Integer)context.NCFD_GEN_DT_ERROR) || dx_year > 2017 || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
            return true
        }
        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.NCFD_SITGRP03, context.NCFD_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.NCFD_SURG03, context.NCFD_SURG03_GROUPCODE, [:]))
            return true
        return false

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy