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

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

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

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

@CompileStatic
class NaaccrTranslatedCompiledRules4 implements CompiledRules {

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

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

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

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

    // ID: NAACCR-00863; TAG: N0785; NAME: Name--Maiden, Check for Unknown (NAACCR)
    public boolean naaccr00863(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nameMaiden))
            return true
        if (functions.GEN_MATCH(functions.GEN_TRIM(untrimmedline.nameMaiden, ((Integer)context.NAACCR_GEN_LEFT)), "([A-Za-z0-9])"))
            return true
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.nameMaiden), context.NAACCR_BIRTHSURNAME_UNK, context.NAACCR_BIRTHSURNAME_UNK_UNK_STR, [:]))
            return true
        return true

    }

    // ID: NAACCR-00864; TAG: N0239; NAME: Name--Middle (NPCR)
    public boolean naaccr00864(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nameMiddle))
            return true
        if (!functions.GEN_MATCH(untrimmedline.nameMiddle, "([A-Za-z](([A-Za-z])|(\\s)|(\\-)|('))*)"))
            return false
        return true

    }

    // ID: NAACCR-00865; TAG: N0169; NAME: Next Follow-Up Source (COC)
    public boolean naaccr00865(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.nextFollowUpSource))
            return true
        if (functions.GEN_INLIST(untrimmedline.nextFollowUpSource, "0-5, 8, 9"))
            return true
        return false

    }

    // ID: NAACCR-00866; TAG: N0544; NAME: Next Follow-Up Source, Date of Diagnosis (COC)
    public boolean naaccr00866(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.nextFollowUpSource))
                return false
        }
        return true

    }

    // ID: NAACCR-00867; TAG: N0735; NAME: Non-Reportable Skin ICDO2 (SEER IF116)
    public boolean naaccr00867(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8110"))
            return false
        return true

    }

    // ID: NAACCR-00868; TAG: N0736; NAME: Non-Reportable Skin ICDO3 (SEER IF117)
    public boolean naaccr00868(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: NAACCR-00869; TAG: N1206; NAME: Obsolete Codes - CS Extension (CS)
    public boolean naaccr00869(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00870; TAG: N1256; NAME: Obsolete Codes - CS Lymph Nodes (CS)
    public boolean naaccr00870(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00871; TAG: N1260; NAME: Obsolete Codes - CS Lymph Nodes Eval (CS)
    public boolean naaccr00871(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00872; TAG: N1261; NAME: Obsolete Codes - CS Mets Eval (CS)
    public boolean naaccr00872(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00873; TAG: N1257; NAME: Obsolete Codes - CS Mets at DX (CS)
    public boolean naaccr00873(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00874; TAG: N1262; NAME: Obsolete Codes - CS Site-Specific Factor 1 (CS)
    public boolean naaccr00874(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "10")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor1)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00875; TAG: N1263; NAME: Obsolete Codes - CS Site-Specific Factor 2 (CS)
    public boolean naaccr00875(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00876; TAG: N1264; NAME: Obsolete Codes - CS Site-Specific Factor 3 (CS)
    public boolean naaccr00876(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.csSiteSpecificFactor3))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "12")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor3)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("12", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor3, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor3, 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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=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 3=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00877; TAG: N1265; NAME: Obsolete Codes - CS Site-Specific Factor 4 (CS)
    public boolean naaccr00877(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.csSiteSpecificFactor4))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "13")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor4)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("13", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor4, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor4, 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 4=OBSOLETE DATA RETAINED - not allowed if DX > 2009')
                }
                if ((functions.GEN_INLIST(t_obs_type, "1 ,5 ,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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=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 4=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00878; TAG: N1266; NAME: Obsolete Codes - CS Site-Specific Factor 5 (CS)
    public boolean naaccr00878(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.csSiteSpecificFactor5))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "14")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor5)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("14", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor5, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor5, 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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=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 5=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00879; TAG: N1267; NAME: Obsolete Codes - CS Site-Specific Factor 6 (CS)
    public boolean naaccr00879(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.csSiteSpecificFactor6))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "15")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor6)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("15", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor6, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor6, 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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=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 6=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00880; TAG: N1408; NAME: Obsolete Codes - CS Site-Specific Factor 7 (CS)
    public boolean naaccr00880(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.csSiteSpecificFactor7))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "16")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor7)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("16", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor7, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor7, 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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=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 7=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00881; TAG: N1409; NAME: Obsolete Codes - CS Site-Specific Factor 8 (CS)
    public boolean naaccr00881(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "17")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor8)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00882; TAG: N1410; NAME: Obsolete Codes - CS Site-Specific Factor 9 (CS)
    public boolean naaccr00882(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.csSiteSpecificFactor9))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "18")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor9)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("18", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor9, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor9, 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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=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 9=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00883; TAG: N1411; NAME: Obsolete Codes - CS Site-Specific Factor10 (CS)
    public boolean naaccr00883(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "19")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor10)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00884; TAG: N1412; NAME: Obsolete Codes - CS Site-Specific Factor11 (CS)
    public boolean naaccr00884(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 = new char[100], descr = new char[100], 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.csSiteSpecificFactor11))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "20")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor11)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("20", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor11, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor11, 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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=OBSOLETE DATA CONVERTED V0203')
                }
                if (functions.GEN_INLIST(t_obs_type, "12")) {
                    if (!functions.GEN_INLIST(t_schema_name, "Testis")) {
                        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                        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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=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 Factor11=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00885; TAG: N1413; NAME: Obsolete Codes - CS Site-Specific Factor12 (CS)
    public boolean naaccr00885(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 = new char[100], descr = new char[100], 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.csSiteSpecificFactor12))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "21")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor12)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("21", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor12, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor12, 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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=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 Factor12=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00886; TAG: N1414; NAME: Obsolete Codes - CS Site-Specific Factor13 (CS)
    public boolean naaccr00886(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 = new char[100], descr = new char[100], 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.csSiteSpecificFactor13))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "22")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor13)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("22", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor13, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor13, 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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=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 Factor13=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00887; TAG: N1415; NAME: Obsolete Codes - CS Site-Specific Factor15 (CS)
    public boolean naaccr00887(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 = new char[100], descr = new char[100], 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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "24")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor15)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00888; TAG: N1416; NAME: Obsolete Codes - CS Site-Specific Factor19 (CS)
    public boolean naaccr00888(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 = new char[100], descr = new char[100], 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.csSiteSpecificFactor19))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "28")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor19)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("28", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor19, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor19, 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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=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 Factor19=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00889; TAG: N1417; NAME: Obsolete Codes - CS Site-Specific Factor21 (CS)
    public boolean naaccr00889(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.csSiteSpecificFactor21))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "30")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor21)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("30", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor21, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor21, 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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=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 Factor21=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00890; TAG: N1418; NAME: Obsolete Codes - CS Site-Specific Factor22 (CS)
    public boolean naaccr00890(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.csSiteSpecificFactor22))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "31")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor22)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("31", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor22, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor22, 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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=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 Factor22=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00891; TAG: N1419; NAME: Obsolete Codes - CS Site-Specific Factor23 (CS)
    public boolean naaccr00891(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.csSiteSpecificFactor23))
            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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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, "32")
        functions.GEN_STRCAT(t_index1, untrimmedline.csSiteSpecificFactor23)
        
        if (functions.GEN_RLOOKUP(t_index1, context.NAACCR_CS_OBS, context.NAACCR_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("32", table) == 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor23, code_low) >= 0 && functions.GEN_STRCMP(untrimmedline.csSiteSpecificFactor23, 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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=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 Factor23=OBSOLETE DATA RETAINED V0204 - not allowed if CS Version Input Original > or = 020440')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00892; TAG: N1268; NAME: Obsolete Codes - CS Site-Specific Factor25 (CS)
    public boolean naaccr00892(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00893; TAG: N1258; NAME: Obsolete Codes - CS Tumor Size (CS)
    public boolean naaccr00893(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00894; TAG: N1259; NAME: Obsolete Codes - CS Tumor Size/Ext Eval (CS)
    public boolean naaccr00894(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        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.NAACCR_CS_OBS, context.NAACCR_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: NAACCR-00895; TAG: N1966; NAME: Obsolete Histology ICDO3, Date of DX (SEER)
    public boolean naaccr00895(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.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_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.NAACCR_OBSHISTO, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_OBSHISTO_HISTOBS, untrimmedline.histologicTypeIcdO3, ['GROUP':GROUP, 'OBSYEAR':OBSYEAR, 'HISTUSE':HISTUSE, 'HISTOBS':HISTOBS]))
            return true
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_OBSHISTO, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_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: NAACCR-00896; TAG: N0167; NAME: Occupation Source (NPCR)
    public boolean naaccr00896(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.occupationSource, "0-3,7-9", "(\\d)") || functions.GEN_EMPTY(untrimmedline.occupationSource)

    }

    // ID: NAACCR-00897; TAG: N0870; NAME: Over-ride Misuse (NAACCR)
    public boolean naaccr00897(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int total
        
        total = 0
        
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteType))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideHistology))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideAgeSiteMorph))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSeqnoDxconf))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteLatSeqno))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSurgDxconf))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideReportSource))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideIllDefineSite))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideLeukLymphoma))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteBehavior))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteEodDxDt))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteLatEod))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteLatMorph))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSsNodespos))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSsTnmN))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSsTnmM))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideAcsnClassSeq))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideHospseqDxconf))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideCocSiteType))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideHospseqSite))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideSiteTnmStggrp))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideTnmStage))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideTnmTis))
            total = total + 1
        if (!functions.GEN_EMPTY(untrimmedline.overRideNameSex))
            total = total + 1
        if (total > 6)
            return true
        else
            return true
        
        return true

    }

    // ID: NAACCR-00898; TAG: N0714; NAME: PIN III ICDO3, Date of Diagnosis (SEER IF110)
    public boolean naaccr00898(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8148") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
                return false
        }
        return true

    }

    // ID: NAACCR-00899; TAG: N1162; NAME: Path Date Spec Collect 1 (NAACCR)
    public boolean naaccr00899(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_pathspec = new char[15], t_date = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.pathDateSpecCollect1))
            return true
        functions.GEN_STRCPY(t_pathspec, untrimmedline.pathDateSpecCollect1)
        functions.GEN_STRCPY(t_date, functions.GEN_SUBSTR(t_pathspec, 1, 8))
        
        if (functions.GEN_VALID_DATE_IOP(binding, t_date))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date error: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-00900; TAG: N1167; NAME: Path Date Spec Collect 2 (NAACCR)
    public boolean naaccr00900(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_pathspec = new char[15], t_date = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.pathDateSpecCollect2))
            return true
        functions.GEN_STRCPY(t_pathspec, untrimmedline.pathDateSpecCollect2)
        functions.GEN_STRCPY(t_date, functions.GEN_SUBSTR(t_pathspec, 1, 8))
        
        if (functions.GEN_VALID_DATE_IOP(binding, t_date))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date error: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-00901; TAG: N1168; NAME: Path Date Spec Collect 3 (NAACCR)
    public boolean naaccr00901(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_pathspec = new char[15], t_date = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.pathDateSpecCollect3))
            return true
        functions.GEN_STRCPY(t_pathspec, untrimmedline.pathDateSpecCollect3)
        functions.GEN_STRCPY(t_date, functions.GEN_SUBSTR(t_pathspec, 1, 8))
        
        if (functions.GEN_VALID_DATE_IOP(binding, t_date))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date error: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-00902; TAG: N1169; NAME: Path Date Spec Collect 4 (NAACCR)
    public boolean naaccr00902(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_pathspec = new char[15], t_date = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.pathDateSpecCollect4))
            return true
        functions.GEN_STRCPY(t_pathspec, untrimmedline.pathDateSpecCollect4)
        functions.GEN_STRCPY(t_date, functions.GEN_SUBSTR(t_pathspec, 1, 8))
        
        if (functions.GEN_VALID_DATE_IOP(binding, t_date))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date error: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-00903; TAG: N1170; NAME: Path Date Spec Collect 5 (NAACCR)
    public boolean naaccr00903(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_pathspec = new char[15], t_date = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.pathDateSpecCollect5))
            return true
        functions.GEN_STRCPY(t_pathspec, untrimmedline.pathDateSpecCollect5)
        functions.GEN_STRCPY(t_date, functions.GEN_SUBSTR(t_pathspec, 1, 8))
        
        if (functions.GEN_VALID_DATE_IOP(binding, t_date))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'Date error: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-00904; TAG: N1157; NAME: Path Order Phys Lic No 1 (NAACCR)
    public boolean naaccr00904(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderPhysLicNo1))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderPhysLicNo1, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00905; TAG: N1158; NAME: Path Order Phys Lic No 2 (NAACCR)
    public boolean naaccr00905(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderPhysLicNo2))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderPhysLicNo2, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00906; TAG: N1159; NAME: Path Order Phys Lic No 3 (NAACCR)
    public boolean naaccr00906(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderPhysLicNo3))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderPhysLicNo3, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00907; TAG: N1160; NAME: Path Order Phys Lic No 4 (NAACCR)
    public boolean naaccr00907(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderPhysLicNo4))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderPhysLicNo4, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00908; TAG: N1161; NAME: Path Order Phys Lic No 5 (NAACCR)
    public boolean naaccr00908(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderPhysLicNo5))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderPhysLicNo5, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00909; TAG: N1147; NAME: Path Ordering Fac No 1 (NAACCR)
    public boolean naaccr00909(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderingFacNo1))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderingFacNo1, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00910; TAG: N1148; NAME: Path Ordering Fac No 2 (NAACCR)
    public boolean naaccr00910(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderingFacNo2))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderingFacNo2, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00911; TAG: N1149; NAME: Path Ordering Fac No 3 (NAACCR)
    public boolean naaccr00911(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderingFacNo3))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderingFacNo3, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00912; TAG: N1150; NAME: Path Ordering Fac No 4 (NAACCR)
    public boolean naaccr00912(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderingFacNo4))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderingFacNo4, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00913; TAG: N1151; NAME: Path Ordering Fac No 5 (NAACCR)
    public boolean naaccr00913(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathOrderingFacNo5))
            return true
        return functions.GEN_MATCH(untrimmedline.pathOrderingFacNo5, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00914; TAG: N1152; NAME: Path Report Number 1 (NAACCR)
    public boolean naaccr00914(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportNumber1))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportNumber1, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00915; TAG: N1153; NAME: Path Report Number 2 (NAACCR)
    public boolean naaccr00915(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportNumber2))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportNumber2, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00916; TAG: N1154; NAME: Path Report Number 3 (NAACCR)
    public boolean naaccr00916(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportNumber3))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportNumber3, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00917; TAG: N1155; NAME: Path Report Number 4 (NAACCR)
    public boolean naaccr00917(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportNumber4))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportNumber4, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00918; TAG: N1156; NAME: Path Report Number 5 (NAACCR)
    public boolean naaccr00918(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportNumber5))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportNumber5, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00919; TAG: N1137; NAME: Path Report Type 1 (NAACCR)
    public boolean naaccr00919(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportType1))
            return true
        return functions.GEN_INLIST(untrimmedline.pathReportType1, "01-11,98,99", "(\\d\\d)")

    }

    // ID: NAACCR-00920; TAG: N1138; NAME: Path Report Type 2 (NAACCR)
    public boolean naaccr00920(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportType2))
            return true
        return functions.GEN_INLIST(untrimmedline.pathReportType2, "01-11,98,99", "(\\d\\d)")

    }

    // ID: NAACCR-00921; TAG: N1139; NAME: Path Report Type 3 (NAACCR)
    public boolean naaccr00921(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportType3))
            return true
        return functions.GEN_INLIST(untrimmedline.pathReportType3, "01-11,98,99", "(\\d\\d)")

    }

    // ID: NAACCR-00922; TAG: N1140; NAME: Path Report Type 4 (NAACCR)
    public boolean naaccr00922(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportType4))
            return true
        return functions.GEN_INLIST(untrimmedline.pathReportType4, "01-11,98,99", "(\\d\\d)")

    }

    // ID: NAACCR-00923; TAG: N1141; NAME: Path Report Type 5 (NAACCR)
    public boolean naaccr00923(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportType5))
            return true
        return functions.GEN_INLIST(untrimmedline.pathReportType5, "01-11,98,99", "(\\d\\d)")

    }

    // ID: NAACCR-00924; TAG: N1142; NAME: Path Reporting Fac ID 1 (NAACCR)
    public boolean naaccr00924(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportingFacId1))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportingFacId1, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00925; TAG: N1143; NAME: Path Reporting Fac ID 2 (NAACCR)
    public boolean naaccr00925(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportingFacId2))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportingFacId2, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00926; TAG: N1144; NAME: Path Reporting Fac ID 3 (NAACCR)
    public boolean naaccr00926(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportingFacId3))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportingFacId3, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00927; TAG: N1145; NAME: Path Reporting Fac ID 4 (NAACCR)
    public boolean naaccr00927(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportingFacId4))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportingFacId4, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00928; TAG: N1146; NAME: Path Reporting Fac ID 5 (NAACCR)
    public boolean naaccr00928(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.pathReportingFacId5))
            return true
        return functions.GEN_MATCH(untrimmedline.pathReportingFacId5, "([^ \\t\\r\\n\\v\\f]((.))*)")

    }

    // ID: NAACCR-00929; TAG: N0058; NAME: Patient ID Number (SEER CASENUM)
    public boolean naaccr00929(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: NAACCR-00930; TAG: N0756; NAME: Patient System ID-Hosp (NAACCR)
    public boolean naaccr00930(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.patientSystemIdHosp))
            return true
        if (functions.GEN_MATCH(untrimmedline.patientSystemIdHosp, "(\\d\\d\\d\\d\\d\\d\\d\\d)") && functions.GEN_VAL(untrimmedline.patientSystemIdHosp) > 0)
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00931; TAG: N0210; NAME: Physician 3 (COC)
    public boolean naaccr00931(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.physician3))
            return true
        return functions.GEN_MATCH(untrimmedline.physician3, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")

    }

    // ID: NAACCR-00932; TAG: N0211; NAME: Physician 4 (COC)
    public boolean naaccr00932(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.physician4))
            return true
        return functions.GEN_MATCH(untrimmedline.physician4, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")

    }

    // ID: NAACCR-00933; TAG: N0153; NAME: Physician--Follow-Up (COC)
    public boolean naaccr00933(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.physicianFollowUp))
            return true
        return functions.GEN_MATCH(untrimmedline.physicianFollowUp, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")

    }

    // ID: NAACCR-00934; TAG: N0381; NAME: Physician--Follow-Up, Date of Diagnosis (COC)
    public boolean naaccr00934(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.physicianFollowUp))
                return false
        }
        return true

    }

    // ID: NAACCR-00935; TAG: N0154; NAME: Physician--Primary Surg (COC)
    public boolean naaccr00935(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.physicianPrimarySurg))
            return true
        return functions.GEN_MATCH(untrimmedline.physicianPrimarySurg, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")

    }

    // ID: NAACCR-00936; TAG: N0382; NAME: Physician--Primary Surg, Date of Diagnosis (COC)
    public boolean naaccr00936(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.physicianPrimarySurg))
                return false
        }
        return true

    }

    // ID: NAACCR-00937; TAG: N0241; NAME: Place of Death (NAACCR)
    public boolean naaccr00937(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeath))
            return true
        return functions.GEN_ILOOKUP(untrimmedline.placeOfDeath, context.NAACCR_DPLACE, context.NAACCR_DPLACE_CODE, [:])

    }

    // ID: NAACCR-00938; TAG: N1675; NAME: Place of Death--Geocode, Country, State (NAACCR)
    public boolean naaccr00938(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] dplace_cntry_state = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeath) || functions.GEN_EMPTY(untrimmedline.placeOfDeathCountry) || functions.GEN_EMPTY(untrimmedline.placeOfDeathState))
            return true
        functions.GEN_STRCPY(dplace_cntry_state, untrimmedline.placeOfDeath)
        functions.GEN_STRCAT(dplace_cntry_state, untrimmedline.placeOfDeathCountry)
        functions.GEN_STRCAT(dplace_cntry_state, untrimmedline.placeOfDeathState)
        
        if (!functions.GEN_LOOKUP(dplace_cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_GEOCNTRYST, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00939; TAG: N0242; NAME: Place of Death, Vital Status (NAACCR)
    public boolean naaccr00939(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.placeOfDeath, "(997)")) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1"))
                return false
        }
        return true

    }

    // ID: NAACCR-00940; TAG: N1670; NAME: Place of Death--Country (NAACCR)
    public boolean naaccr00940(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.placeOfDeathCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00941; TAG: N1761; NAME: Place of Death--Country, Date of Diagnosis (NAACCR)
    public boolean naaccr00941(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "XNI,XCB,XEN,XSC,XGR,XYG,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00942; TAG: N1903; NAME: Place of Death--Country, Place of Death--State (NAACCR)
    public boolean naaccr00942(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.placeOfDeathCountry) || functions.GEN_EMPTY(untrimmedline.placeOfDeathState))
            return true
        if (functions.GEN_INLIST(untrimmedline.placeOfDeathState, "XX") && functions.GEN_INLIST(untrimmedline.placeOfDeathCountry, "ZZX"))
            return false
        functions.GEN_STRCPY(cntry_state, untrimmedline.placeOfDeathCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.placeOfDeathState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00943; TAG: N1702; NAME: Place of Death--Country, Vital Status (NPCR)
    public boolean naaccr00943(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_EMPTY(untrimmedline.placeOfDeathCountry)) {
            if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00944; TAG: N1674; NAME: Place of Death--State (NAACCR)
    public boolean naaccr00944(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathState))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.placeOfDeathState, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_STATE, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00945; TAG: N1760; NAME: Place of Death--State, Date of Diagnosis (NAACCR)
    public boolean naaccr00945(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathState))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.placeOfDeathState, "NN,MM,PP,XN"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00946; TAG: N1701; NAME: Place of Death--State, Vital Status (NPCR)
    public boolean naaccr00946(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.placeOfDeathState)) {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.vitalStatus, "1"))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-00948; TAG: N0811; NAME: Primary Payer at DX (NPCR)
    public boolean naaccr00948(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: NAACCR-00949; TAG: N1031; NAME: Primary Payer at DX, Date of DX (SEER IF181)
    public boolean naaccr00949(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006) {
            if (functions.GEN_EMPTY(untrimmedline.primaryPayerAtDx))
                return false
        }
        return true

    }

    // ID: NAACCR-00950; TAG: N0007; NAME: Primary Site (SEER SITE)
    public boolean naaccr00950(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.NAACCR_SITE_TBL, context.NAACCR_SITE_TBL_SITECODE, [:])

    }

    // ID: NAACCR-00951; TAG: N2192; NAME: Primary Site, AJCC M - Ed 7, ICDO3 (COC)
    public boolean naaccr00951(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] cM = new char[5]
        char[] pM = new char[5]
        
        char[] t_GrpMcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010 || dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
        
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinM, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinM)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathM, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathM)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4"))) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
                            functions.GEN_STRCPY(SiteGrp, "028")
                    }
                }
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            functions.GEN_STRCPY(pM, functions.GEN_SUBSTR(untrimmedline.tnmPathM, 2, 3))
        if (functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
            functions.GEN_STRCPY(pM, untrimmedline.tnmPathM)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            functions.GEN_STRCPY(cM, functions.GEN_SUBSTR(untrimmedline.tnmClinM, 2, 3))
        if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88"))
            functions.GEN_STRCPY(cM, untrimmedline.tnmClinM)
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
            functions.GEN_STRCPY(t_GrpMcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpMcode, cM)
        
            if (!functions.GEN_LOOKUP(t_GrpMcode, context.NAACCR_AJC7MC, context.NAACCR_AJC7MC_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(t_GrpMcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpMcode, pM)
        
        if (!functions.GEN_LOOKUP(t_GrpMcode, context.NAACCR_AJC7MP, context.NAACCR_AJC7MP_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
        }
        return true

    }

    // ID: NAACCR-00952; TAG: N2193; NAME: Primary Site, AJCC M - Ed 7, ICDO3 (NPCR)
    public boolean naaccr00952(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPMCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpMcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
        
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinM, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinM)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathM, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathM)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinM) && functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "490-499", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8934,8940-9044,9060-9136,9141-9582"))
                            functions.GEN_STRCPY(SiteGrp, "028")
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinM)) {
            functions.GEN_STRCPY(t_GrpMcode, SiteGrp)
        
            functions.GEN_STRCAT(t_GrpMcode, untrimmedline.tnmClinM)
        
            if (!functions.GEN_LOOKUP(t_GrpMcode, context.NAACCR_AJC7MC, context.NAACCR_AJC7MC_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin M code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathM))
            return true
        functions.GEN_STRCPY(t_GrpMcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpMcode, untrimmedline.tnmPathM)
        
        if (!functions.GEN_LOOKUP(t_GrpMcode, context.NAACCR_AJC7MP, context.NAACCR_AJC7MP_GRPMCODE, ['GRPMCODE':GRPMCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path M code is invalid for site/hist combination')
        }
        return true

    }

    // ID: NAACCR-00953; TAG: N2195; NAME: Primary Site, AJCC N - Ed 7, ICDO3 (COC)
    public boolean naaccr00953(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] cN = new char[5]
        char[] pN = new char[5]
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010 || dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
        
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinN)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathN)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4"))) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            functions.GEN_STRCPY(pN, functions.GEN_SUBSTR(untrimmedline.tnmPathN, 2, 3))
        if (functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
            functions.GEN_STRCPY(pN, untrimmedline.tnmPathN)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            functions.GEN_STRCPY(cN, functions.GEN_SUBSTR(untrimmedline.tnmClinN, 2, 3))
        if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88"))
            functions.GEN_STRCPY(cN, untrimmedline.tnmClinN)
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNcode, cN)
        
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.NAACCR_AJC7NC, context.NAACCR_AJC7NC_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpNcode, pN)
        
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.NAACCR_AJC7NP, context.NAACCR_AJC7NP_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

    // ID: NAACCR-00954; TAG: N2196; NAME: Primary Site, AJCC N - Ed 7, ICDO3 (NPCR)
    public boolean naaccr00954(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPNCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpNcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
        
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinN)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathN, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathN)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinN) && functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "051")) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                functions.GEN_STRCPY(SiteGrp, "51A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                        functions.GEN_STRCPY(SiteGrp, "51A")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                            functions.GEN_STRCPY(SiteGrp, "51B")
                                                        else
                                                            functions.GEN_STRCPY(SiteGrp, "999")
                                                    }
                                                }
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                    functions.GEN_STRCPY(SiteGrp, "999")
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinN)) {
            functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmClinN)
        
            if (!functions.GEN_LOOKUP(t_GrpNcode, context.NAACCR_AJC7NC, context.NAACCR_AJC7NC_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin N code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathN))
            return true
        functions.GEN_STRCPY(t_GrpNcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpNcode, untrimmedline.tnmPathN)
        
        if (!functions.GEN_LOOKUP(t_GrpNcode, context.NAACCR_AJC7NP, context.NAACCR_AJC7NP_GRPNCODE, ['GRPNCODE':GRPNCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path N code is invalid for site/hist combination')
        }
        return true

    }

    // ID: NAACCR-00955; TAG: N0648; NAME: Primary Site, AJCC Stage Group - Ed 3/4, ICDO2 (COC)
    public boolean naaccr00955(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[3], GRPSTAGE = new char[100]
        int reqflag
        int dx_year
        
        char[] GrpStg = new char[11]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "00,03,04,99"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "03,04")) {
            if (dx_year < 1987)
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "00,99")) {
            if (dx_year < 1991 || dx_year > 1996) {
                return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.pediatricStagingSystem)) {
            if (!functions.GEN_INLIST(untrimmedline.pediatricStagingSystem, "88")) {
                return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1,9")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (dx_year < 1991) {
                    return true
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1,9")) {
                    return true
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949,9730-9739,9140,8832,8833"))
                    return true
                else {
                    // *** START function call GetSiteGroup()
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
                        functions.GEN_STRCPY(SiteGrp, "99")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                            functions.GEN_STRCPY(SiteGrp, "99")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                                functions.GEN_STRCPY(SiteGrp, "99")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                                    functions.GEN_STRCPY(SiteGrp, "99")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9650-9667"))
                                        functions.GEN_STRCPY(SiteGrp, "47")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595, 9670-9717"))
                                            functions.GEN_STRCPY(SiteGrp, "48")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "440,442-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                functions.GEN_STRCPY(SiteGrp, "24")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "441", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                    functions.GEN_STRCPY(SiteGrp, "39")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                        functions.GEN_STRCPY(SiteGrp, "41")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                            functions.GEN_STRCPY(SiteGrp, "4A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                                functions.GEN_STRCPY(SiteGrp, "4B")
                                                            else {
                                                                functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                                                                if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJCSITGP, context.NAACCR_AJCSITGP_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, "99")
                                                                }
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "99")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
        null// *** END function call GetSiteGroup()
                    // *** START function call CheckIfReq()
        
                    reqflag = 0
        
                    if (functions.GEN_INLIST(SiteGrp, "03,04,05,06,07")) {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8573, 8940-8941"))
                            reqflag = 1
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "08")) {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8020, 8021, 8050-8053, 8330-8340, 8510-8512"))
                                reqflag = 1
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "09,11,12,13,14,17")) {
                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8244-8573, 8930-8941"))
                                    reqflag = 1
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "18")) {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8250-8573, 8930-8941"))
                                        reqflag = 1
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "19")) {
                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8250-8573, 8940-8941"))
                                            reqflag = 1
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "10")) {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8231, 8244-8573, 8930-8941"))
                                                reqflag = 1
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "23,25,28,29,33,34,36,37")) {
                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8230, 8244-8573, 8940-8941"))
                                                    reqflag = 1
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "35")) {
                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8230, 8250-8573, 8940-8941"))
                                                        reqflag = 1
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "26,27,30")) {
                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8230, 8244-8573, 8940-8941"))
                                                            reqflag = 1
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "24,39,4A,4B")) {
                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8790"))
                                                                reqflag = 1
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "15,16")) {
                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8245-8263, 8320, 8401, 8480-8573, 8940-8941"))
                                                                    reqflag = 1
                                                            }
                                                            else {
                                                                if (functions.GEN_INLIST(SiteGrp, "20")) {
                                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9050-9053"))
                                                                        reqflag = 1
                                                                }
                                                                else {
                                                                    if (functions.GEN_INLIST(SiteGrp, "21")) {
                                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9180-9340"))
                                                                            reqflag = 1
                                                                    }
                                                                    else {
                                                                        if (functions.GEN_INLIST(SiteGrp, "22")) {
                                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8800-8830,8840-8920,8933,8963,8980-8991"))
                                                                                reqflag = 1
                                                                        }
                                                                        else {
                                                                            if (functions.GEN_INLIST(SiteGrp, "22")) {
                                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9040-9044,9050-9055,9120-9340,9370,9490,9500-9504,9540-9580"))
                                                                                    reqflag = 1
                                                                            }
                                                                            else {
                                                                                if (functions.GEN_INLIST(SiteGrp, "31")) {
                                                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8110, 8140-8573, 8940-8941"))
                                                                                        reqflag = 1
                                                                                }
                                                                                else {
                                                                                    if (functions.GEN_INLIST(SiteGrp, "32")) {
                                                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9060-9102"))
                                                                                            reqflag = 1
                                                                                    }
                                                                                    else {
                                                                                        if (functions.GEN_INLIST(SiteGrp, "43")) {
                                                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9510-9512"))
                                                                                                reqflag = 1
                                                                                        }
                                                                                        else {
                                                                                            if (functions.GEN_INLIST(SiteGrp, "46")) {
                                                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9380-9570"))
                                                                                                    reqflag = 1
                                                                                            }
                                                                                            else {
                                                                                                if (functions.GEN_INLIST(SiteGrp, "47")) {
                                                                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9650-9667"))
                                                                                                        reqflag = 1
                                                                                                }
                                                                                                else {
                                                                                                    if (functions.GEN_INLIST(SiteGrp, "48")) {
                                                                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9670-9717"))
                                                                                                            reqflag = 1
                                                                                                    }
                                                                                                    else {
                                                                                                        if (functions.GEN_INLIST(SiteGrp, "49")) {
                                                                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8960"))
                                                                                                                reqflag = 1
                                                                                                        }
                                                                                                        else {
                                                                                                            if (functions.GEN_INLIST(SiteGrp, "50")) {
                                                                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9490-9507"))
                                                                                                                    reqflag = 1
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // *** END function call CheckIfReq()
                    if (reqflag == 0)
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'TNM Clin and/or Path Stage Group required for site/hist combination')
                }
            }
        }
        // *** START function call GetSiteGroup()
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
            functions.GEN_STRCPY(SiteGrp, "99")
        else {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                functions.GEN_STRCPY(SiteGrp, "99")
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                    functions.GEN_STRCPY(SiteGrp, "99")
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                        functions.GEN_STRCPY(SiteGrp, "99")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9650-9667"))
                            functions.GEN_STRCPY(SiteGrp, "47")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595, 9670-9717"))
                                functions.GEN_STRCPY(SiteGrp, "48")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "440,442-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                    functions.GEN_STRCPY(SiteGrp, "24")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "441", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                        functions.GEN_STRCPY(SiteGrp, "39")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                            functions.GEN_STRCPY(SiteGrp, "41")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                functions.GEN_STRCPY(SiteGrp, "4A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                    functions.GEN_STRCPY(SiteGrp, "4B")
                                                else {
                                                    functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                                                    if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJCSITGP, context.NAACCR_AJCSITGP_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, "99")
                                                    }
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "99")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        null// *** END function call GetSiteGroup()
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88,99")) {
            // *** START function call ValidateClin()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJCSTAGC, context.NAACCR_AJCSTAGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for leukemia cases')
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for plasma cell tumors')
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for Kaposi\'s Sarcoma')
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for dermatofibrosarcoma')
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
                        }
                    }
                }
            }
        null// *** END function call ValidateClin()
        }
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88,99")) {
            // *** START function call ValidatePath()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJCSTAGP, context.NAACCR_AJCSTAGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for leukemia cases')
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for plasma cell tumors')
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for Kaposi\'s Sarcoma')
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for dermatofibrosarcoma')
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
                        }
                    }
                }
            }
        null// *** END function call ValidatePath()
        }
        return true

    }

    // ID: NAACCR-00956; TAG: N0649; NAME: Primary Site, AJCC Stage Group - Ed 5, ICDO2 (COC)
    public boolean naaccr00956(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[3], GRPSTAGE = new char[100]
        
        int reqflag
        int dx_year
        
        char[] GrpStg = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "00,05,99"))
            return true
        if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "05")) {
            if (dx_year < 1996)
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "00,99")) {
            if (dx_year < 1997 || dx_year > 2002) {
                return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.pediatricStagingSystem)) {
            if (!functions.GEN_INLIST(untrimmedline.pediatricStagingSystem, "88")) {
                return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1,9")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1,9")) {
                    return true
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949,9730-9739,9140,8832,8833"))
                    return true
                else {
                    // *** START function call Get_Site_Group()
        
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
                        functions.GEN_STRCPY(SiteGrp, "99")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                            functions.GEN_STRCPY(SiteGrp, "99")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                                functions.GEN_STRCPY(SiteGrp, "99")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                                    functions.GEN_STRCPY(SiteGrp, "99")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9650-9667"))
                                        functions.GEN_STRCPY(SiteGrp, "48")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595, 9670-9717"))
                                            functions.GEN_STRCPY(SiteGrp, "49")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8120-8130"))
                                                functions.GEN_STRCPY(SiteGrp, "39")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "440,441-449,510,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                    functions.GEN_STRCPY(SiteGrp, "24")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                        functions.GEN_STRCPY(SiteGrp, "42")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                            functions.GEN_STRCPY(SiteGrp, "4A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                                functions.GEN_STRCPY(SiteGrp, "4B")
                                                            else {
                                                                functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                                                                if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC5SIGP, context.NAACCR_AJC5SIGP_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, "99")
                                                                }
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "99")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
        null// *** END function call Get_Site_Group()
                    // *** START function call Check_If_Req()
        
                    reqflag = 0
        
                    if (functions.GEN_INLIST(SiteGrp, "03,04,05,06,07")) {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8573, 8940-8941"))
                            reqflag = 1
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "08")) {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8020, 8021, 8050-8053, 8330-8340, 8510-8512"))
                                reqflag = 1
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "09,11,12,13,14,17")) {
                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8244-8573, 8930-8941"))
                                    reqflag = 1
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "18")) {
                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8250-8573, 8930-8941"))
                                        reqflag = 1
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "19")) {
                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8250-8573, 8940-8941"))
                                            reqflag = 1
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "10")) {
                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8231, 8244-8573, 8930-8941"))
                                                reqflag = 1
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "23,25,30,31,27,33,38,37,39")) {
                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8230, 8244-8573, 8940-8941"))
                                                    reqflag = 1
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "32")) {
                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9100-9104"))
                                                        reqflag = 1
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "36")) {
                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8230, 8250-8573, 8940-8941"))
                                                            reqflag = 1
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "28,29,26")) {
                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8230, 8244-8573, 8940-8941"))
                                                                reqflag = 1
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "24,4A,4B")) {
                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8790"))
                                                                    reqflag = 1
                                                            }
                                                            else {
                                                                if (functions.GEN_INLIST(SiteGrp, "15,16")) {
                                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8231, 8245-8263, 8320, 8401, 8480-8573, 8940-8941"))
                                                                        reqflag = 1
                                                                }
                                                                else {
                                                                    if (functions.GEN_INLIST(SiteGrp, "20")) {
                                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9050-9053"))
                                                                            reqflag = 1
                                                                    }
                                                                    else {
                                                                        if (functions.GEN_INLIST(SiteGrp, "21")) {
                                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8810-8814,8850-8855,9180-9340"))
                                                                                reqflag = 1
                                                                        }
                                                                        else {
                                                                            if (functions.GEN_INLIST(SiteGrp, "22")) {
                                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8800-8830,8840-8920,8933,8963,8980-8991"))
                                                                                    reqflag = 1
                                                                            }
                                                                            else {
                                                                                if (functions.GEN_INLIST(SiteGrp, "22")) {
                                                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9040-9044,9050-9055,9120-9340,9370,9490,9500-9504,9540-9580"))
                                                                                        reqflag = 1
                                                                                }
                                                                                else {
                                                                                    if (functions.GEN_INLIST(SiteGrp, "34")) {
                                                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8010-8110, 8140-8573, 8940-8941"))
                                                                                            reqflag = 1
                                                                                    }
                                                                                    else {
                                                                                        if (functions.GEN_INLIST(SiteGrp, "34")) {
                                                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8120-8130"))
                                                                                                reqflag = 1
                                                                                        }
                                                                                        else {
                                                                                            if (functions.GEN_INLIST(SiteGrp, "35")) {
                                                                                                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9060-9102"))
                                                                                                    reqflag = 1
                                                                                            }
                                                                                            else {
                                                                                                if (functions.GEN_INLIST(SiteGrp, "44")) {
                                                                                                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9510-9512"))
                                                                                                        reqflag = 1
                                                                                                }
                                                                                                else {
                                                                                                    if (functions.GEN_INLIST(SiteGrp, "48")) {
                                                                                                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9650-9667"))
                                                                                                            reqflag = 1
                                                                                                    }
                                                                                                    else {
                                                                                                        if (functions.GEN_INLIST(SiteGrp, "49")) {
                                                                                                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595,9670-9717"))
                                                                                                                reqflag = 1
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // *** END function call Check_If_Req()
                    if (reqflag == 0)
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'TNM Clin and/or Path Stage Group required for site/hist combination')
                }
            }
        }
        // *** START function call Get_Site_Group()
        
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
            functions.GEN_STRCPY(SiteGrp, "99")
        else {
            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                functions.GEN_STRCPY(SiteGrp, "99")
            else {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                    functions.GEN_STRCPY(SiteGrp, "99")
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                        functions.GEN_STRCPY(SiteGrp, "99")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9650-9667"))
                            functions.GEN_STRCPY(SiteGrp, "48")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9595, 9670-9717"))
                                functions.GEN_STRCPY(SiteGrp, "49")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8120-8130"))
                                    functions.GEN_STRCPY(SiteGrp, "39")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440,441-449,510,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                        functions.GEN_STRCPY(SiteGrp, "24")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                            functions.GEN_STRCPY(SiteGrp, "42")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                functions.GEN_STRCPY(SiteGrp, "4A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8720-8799"))
                                                    functions.GEN_STRCPY(SiteGrp, "4B")
                                                else {
                                                    functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                                                    if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC5SIGP, context.NAACCR_AJC5SIGP_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, "99")
                                                    }
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "99")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        null// *** END function call Get_Site_Group()
        
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88,99")) {
            // *** START function call Validate_Clin()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC5STGC, context.NAACCR_AJC5STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for leukemia cases')
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for plasma cell tumors')
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for Kaposi\'s Sarcoma')
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for dermatofibrosarcoma')
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
                        }
                    }
                }
            }
        null// *** END function call Validate_Clin()
        }
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88,99")) {
            // *** START function call Validate_Path()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC5STGP, context.NAACCR_AJC5STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9800-9949"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for leukemia cases')
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9730-9739"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for plasma cell tumors')
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9140"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for Kaposi\'s Sarcoma')
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8832,8833"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for dermatofibrosarcoma')
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
                        }
                    }
                }
            }
        null// *** END function call Validate_Path()
        }
        return true

    }

    // ID: NAACCR-00957; TAG: N0647; NAME: Primary Site, AJCC Stage Group - Ed 5, ICDO3 (COC)
    public boolean naaccr00957(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[3], GRPSTAGE = new char[100]
        int reqflag
        int dx_year
        
        char[] GrpStg = new char[10]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "00,05,99"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "05")) {
            if (dx_year < 1996)
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "00,99")) {
            if (dx_year < 1997 || dx_year > 2002) {
                return true
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.pediatricStagingSystem)) {
            if (!functions.GEN_INLIST(untrimmedline.pediatricStagingSystem, "88")) {
                return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,9")) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,9")) {
                    return true
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)) {
            if (functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup)) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9800-9949,9730-9739,9140,8832,8833"))
                    return true
                else {
                    // *** START function call Get_SiteGroup()
        
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9800-9949"))
                        functions.GEN_STRCPY(SiteGrp, "99")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9730-9739"))
                            functions.GEN_STRCPY(SiteGrp, "99")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140"))
                                functions.GEN_STRCPY(SiteGrp, "99")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8832,8833"))
                                    functions.GEN_STRCPY(SiteGrp, "99")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650-9667"))
                                        functions.GEN_STRCPY(SiteGrp, "48")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9599, 9670-9729"))
                                            functions.GEN_STRCPY(SiteGrp, "49")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
                                                functions.GEN_STRCPY(SiteGrp, "39")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "440,441-449,510,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                                    functions.GEN_STRCPY(SiteGrp, "24")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                                        functions.GEN_STRCPY(SiteGrp, "42")
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                                            functions.GEN_STRCPY(SiteGrp, "4A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                                                functions.GEN_STRCPY(SiteGrp, "4B")
                                                            else {
                                                                functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                                                                if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC5SIGP, context.NAACCR_AJC5SIGP_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, "99")
                                                                }
                                                                else
                                                                    functions.GEN_STRCPY(SiteGrp, "99")
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
        null// *** END function call Get_SiteGroup()
                    // *** START function call Check_IfReq()
        
                    reqflag = 0
        
                    if (functions.GEN_INLIST(SiteGrp, "03,04,05,06,07")) {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8573, 8940-8941"))
                            reqflag = 1
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "08")) {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8020, 8021, 8050-8053, 8330-8340, 8510-8512"))
                                reqflag = 1
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "09,11,12,13,14,17")) {
                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8231, 8244-8573, 8930-8941"))
                                    reqflag = 1
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "18")) {
                                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8231, 8250-8573, 8930-8941"))
                                        reqflag = 1
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "19")) {
                                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8231, 8250-8573, 8940-8941"))
                                            reqflag = 1
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "10")) {
                                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8231, 8244-8573, 8930-8941"))
                                                reqflag = 1
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "23,25,30,31,27,33,38,37,39")) {
                                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8230, 8244-8573, 8940-8941"))
                                                    reqflag = 1
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "32")) {
                                                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9100-9104"))
                                                        reqflag = 1
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(SiteGrp, "36")) {
                                                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8230, 8250-8573, 8940-8941"))
                                                            reqflag = 1
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(SiteGrp, "28,29,26")) {
                                                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8230, 8244-8573, 8940-8941"))
                                                                reqflag = 1
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(SiteGrp, "24,4A,4B")) {
                                                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8790"))
                                                                    reqflag = 1
                                                            }
                                                            else {
                                                                if (functions.GEN_INLIST(SiteGrp, "15,16")) {
                                                                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8231, 8245-8263, 8320, 8401, 8480-8573, 8940-8941"))
                                                                        reqflag = 1
                                                                }
                                                                else {
                                                                    if (functions.GEN_INLIST(SiteGrp, "20")) {
                                                                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9053"))
                                                                            reqflag = 1
                                                                    }
                                                                    else {
                                                                        if (functions.GEN_INLIST(SiteGrp, "21")) {
                                                                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8810-8814,8850-8855,9180-9340"))
                                                                                reqflag = 1
                                                                        }
                                                                        else {
                                                                            if (functions.GEN_INLIST(SiteGrp, "22")) {
                                                                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8830,8840-8920,8933,8963,8980-8991"))
                                                                                    reqflag = 1
                                                                            }
                                                                            else {
                                                                                if (functions.GEN_INLIST(SiteGrp, "22")) {
                                                                                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9040-9044,9050-9055,9120-9340,9370,9490,9500-9504,9540-9580"))
                                                                                        reqflag = 1
                                                                                }
                                                                                else {
                                                                                    if (functions.GEN_INLIST(SiteGrp, "34")) {
                                                                                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8010-8110, 8140-8573, 8940-8941"))
                                                                                            reqflag = 1
                                                                                    }
                                                                                    else {
                                                                                        if (functions.GEN_INLIST(SiteGrp, "34")) {
                                                                                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
                                                                                                reqflag = 1
                                                                                        }
                                                                                        else {
                                                                                            if (functions.GEN_INLIST(SiteGrp, "35")) {
                                                                                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9060-9102"))
                                                                                                    reqflag = 1
                                                                                            }
                                                                                            else {
                                                                                                if (functions.GEN_INLIST(SiteGrp, "44")) {
                                                                                                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9512"))
                                                                                                        reqflag = 1
                                                                                                }
                                                                                                else {
                                                                                                    if (functions.GEN_INLIST(SiteGrp, "48")) {
                                                                                                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650-9667"))
                                                                                                            reqflag = 1
                                                                                                    }
                                                                                                    else {
                                                                                                        if (functions.GEN_INLIST(SiteGrp, "49")) {
                                                                                                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9595,9670-9717"))
                                                                                                                reqflag = 1
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    // *** END function call Check_IfReq()
                    if (reqflag == 0)
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'TNM Clin and/or Path Stage Group required for site/hist combination')
                }
            }
        }
        // *** START function call Get_SiteGroup()
        
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9800-9949"))
            functions.GEN_STRCPY(SiteGrp, "99")
        else {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9730-9739"))
                functions.GEN_STRCPY(SiteGrp, "99")
            else {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140"))
                    functions.GEN_STRCPY(SiteGrp, "99")
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8832,8833"))
                        functions.GEN_STRCPY(SiteGrp, "99")
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9650-9667"))
                            functions.GEN_STRCPY(SiteGrp, "48")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9599, 9670-9729"))
                                functions.GEN_STRCPY(SiteGrp, "49")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
                                    functions.GEN_STRCPY(SiteGrp, "39")
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "440,441-449,510,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                        functions.GEN_STRCPY(SiteGrp, "24")
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "690", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                            functions.GEN_STRCPY(SiteGrp, "42")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                                functions.GEN_STRCPY(SiteGrp, "4A")
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8799"))
                                                    functions.GEN_STRCPY(SiteGrp, "4B")
                                                else {
                                                    functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                                                    if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC5SIGP, context.NAACCR_AJC5SIGP_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, "99")
                                                    }
                                                    else
                                                        functions.GEN_STRCPY(SiteGrp, "99")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        null// *** END function call Get_SiteGroup()
        
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinStageGroup) && !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88,99")) {
            // *** START function call Validate_ClinStg()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC5STGC, context.NAACCR_AJC5STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9800-9949"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for leukemia cases')
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9730-9739"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for plasma cell tumors')
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for Kaposi\'s Sarcoma')
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8832,8833"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for dermatofibrosarcoma')
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
                        }
                    }
                }
            }
        null// *** END function call Validate_ClinStg()
        }
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (!functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup) && !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88,99")) {
            // *** START function call Validate_PathStg()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC5STGP, context.NAACCR_AJC5STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE])) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9800-9949"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for leukemia cases')
                else {
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9730-9739"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for plasma cell tumors')
                    else {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for Kaposi\'s Sarcoma')
                        else {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8832,8833"))
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for dermatofibrosarcoma')
                            else
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
                        }
                    }
                }
            }
        null// *** END function call Validate_PathStg()
        }
        return true

    }

    // ID: NAACCR-00958; TAG: N0926; NAME: Primary Site, AJCC Stage Group - Ed 6 (NAACCR)
    public boolean naaccr00958(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[3], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[3], GRPSTAGE = new char[100]
        
        int req_flag
        int permit_flag
        int dx_year
        
        char[] GrpStg = new char[11]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003 || dx_year > 2009)
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStggrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDiagnosis) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStggrp, "1")) {
            if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") || !functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") || !functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
            else
                return true
        }
        // *** START function call Get_SiteGrp6N()
        
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9667,9670-9729"))
            functions.GEN_STRCPY(SiteGrp, "48")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
                functions.GEN_STRCPY(SiteGrp, "39")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8722, 8742-8745, 8761, 8771, 8772, 8780"))
                    functions.GEN_STRCPY(SiteGrp, "24")
                else {
                    functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                    if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC6SIGP, context.NAACCR_AJC6SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH])) {
                        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, "99")
                    }
                    else
                        functions.GEN_STRCPY(SiteGrp, "99")
                }
            }
        }
        null// *** END function call Get_SiteGrp6N()
        
        req_flag = 0
        // *** START function call Check_IfReq6N()
        
        if (functions.GEN_INLIST(SiteGrp, "48"))
            req_flag = 1
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120,8130"))
                req_flag = 1
            else {
                functions.GEN_STRCPY(GrpHist, SiteGrp)
                functions.GEN_STRCAT(GrpHist, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(GrpHist, context.NAACCR_AJC6HIST, context.NAACCR_AJC6HIST_GRPHISTLOW, ['GRP':GRP, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH])) {
                    if (functions.GEN_STRCMP(GRP, SiteGrp) == 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        req_flag = 1
                }
            }
        }
        null// *** END function call Check_IfReq6N()
        
        permit_flag = 0
        // *** START function call Check_IfPermit6N()
        if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
            permit_flag = 1
        else {
            if (functions.GEN_INLIST(SiteGrp, "03-19, 23, 25-31, 33, 34, 36-39, 4A, 4B")) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980, 8981"))
                    permit_flag = 1
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "20,32")) {
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000"))
                        permit_flag = 1
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "21,22")) {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000,8800-9582"))
                            permit_flag = 1
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "24")) {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8742"))
                                permit_flag = 1
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "35")) {
                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980, 8981,9060-9085"))
                                    permit_flag = 1
                            }
                        }
                    }
                }
            }
        }
        // *** END function call Check_IfPermit6N()
        
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (req_flag == 0) {
            if (permit_flag == 0) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88")) {
                    // *** START function call Validate_ClinStg6N()
                    functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
                    if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGC, context.NAACCR_AJC6STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_ClinStg6N()
                }
            }
        }
        else {
            // *** START function call Validate_ClinStg6N()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGC, context.NAACCR_AJC6STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_ClinStg6N()
        }
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (req_flag == 0) {
            if (permit_flag == 0) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
                    // *** START function call Validate_PathStg6N()
                    functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
                    if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGP, context.NAACCR_AJC6STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_PathStg6N()
                }
            }
        }
        else {
            // *** START function call Validate_PathStg6N()
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGP, context.NAACCR_AJC6STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_PathStg6N()
        }
        return true

    }

    // ID: NAACCR-00959; TAG: N1253; NAME: Primary Site, AJCC Stage Group - Ed 6, ICDO3 (COC)
    public boolean naaccr00959(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[3], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[3], GRPSTAGE = new char[100]
        
        int req_flag
        int permit_flag
        int dx_year
        
        char[] GrpStg = new char[11]
        
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003 || dx_year > 2009)
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "06,88"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStggrp, "1")) {
            if (functions.GEN_VAL(untrimmedline.ageAtDiagnosis) > 24)
                return functions.GEN_ERROR_MSG(binding, 'Over-ride applies only to pediatric cases (ages less than 25)')
        }
        if (functions.GEN_INLIST(untrimmedline.overRideSiteTnmStggrp, "1")) {
            if (dx_year < 2008) {
                if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && (functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88") || functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup)))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
            }
        }
        // *** START function call Get_SiteGrp6()
        
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9596,9650-9667,9670-9729"))
            functions.GEN_STRCPY(SiteGrp, "48")
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
                functions.GEN_STRCPY(SiteGrp, "39")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449,510-512,518,519,600-602,608,609,632", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8722, 8742-8745, 8761, 8771, 8772, 8780"))
                    functions.GEN_STRCPY(SiteGrp, "24")
                else {
                    functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
                    if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC6SIGP, context.NAACCR_AJC6SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH])) {
                        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, "99")
                    }
                    else
                        functions.GEN_STRCPY(SiteGrp, "99")
                }
            }
        }
        null// *** END function call Get_SiteGrp6()
        
        req_flag = 0
        // *** START function call Check_IfReq6()
        
        if (functions.GEN_INLIST(SiteGrp, "48"))
            req_flag = 1
        else {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120,8130"))
                req_flag = 1
            else {
                functions.GEN_STRCPY(GrpHist, SiteGrp)
                functions.GEN_STRCAT(GrpHist, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(GrpHist, context.NAACCR_AJC6HIST, context.NAACCR_AJC6HIST_GRPHISTLOW, ['GRP':GRP, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH])) {
                    if (functions.GEN_STRCMP(GRP, SiteGrp) == 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        req_flag = 1
                }
            }
        }
        null// *** END function call Check_IfReq6()
        
        permit_flag = 0
        // *** START function call Check_IfPermit6()
        if (functions.GEN_INLIST(untrimmedline.primarySite, "619", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8120-8130"))
            permit_flag = 1
        else {
            if (functions.GEN_INLIST(SiteGrp, "03-19, 23, 25-31, 33, 34, 36-39,4A,4B")) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980, 8981"))
                    permit_flag = 1
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "20,32")) {
                    if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000"))
                        permit_flag = 1
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "21,22")) {
                        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000,8800-9582"))
                            permit_flag = 1
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "24")) {
                            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8742"))
                                permit_flag = 1
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "35")) {
                                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980, 8981,9060-9085"))
                                    permit_flag = 1
                            }
                        }
                    }
                }
            }
        }
        // *** END function call Check_IfPermit6()
        
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (req_flag == 0) {
            if (permit_flag == 0) {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group should = "88" for site/hist combination')
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88")) {
                    // *** START function call Validate_ClinStg6()
        
                    functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
                    if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGC, context.NAACCR_AJC6STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_ClinStg6()
                }
            }
        }
        else {
        
            // *** START function call Validate_ClinStg6()
        
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmClinStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGC, context.NAACCR_AJC6STGC_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_ClinStg6()
        }
        if (dx_year > 2007) {
            if (functions.GEN_EMPTY(untrimmedline.tnmPathStageGroup))
                return true
        }
        functions.GEN_STRCPY(GrpStg, SiteGrp)
        
        if (req_flag == 0) {
            if (permit_flag == 0) {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group should = "88" for site/hist combination')
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88")) {
                    // *** START function call Validate_PathStg6()
        
                    functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
                    if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGP, context.NAACCR_AJC6STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_PathStg6()
                }
            }
        }
        else {
            // *** START function call Validate_PathStg6()
        
            functions.GEN_STRCAT(GrpStg, untrimmedline.tnmPathStageGroup)
        
            if (!functions.GEN_LOOKUP(GrpStg, context.NAACCR_AJC6STGP, context.NAACCR_AJC6STGP_GRPSTAGE, ['GRPSTAGE':GRPSTAGE]))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path Stage Group is invalid for site/hist combination')
        null// *** END function call Validate_PathStg6()
        }
        return true

    }

    // ID: NAACCR-00962; TAG: N2201; NAME: Primary Site, AJCC T - Ed 7, ICDO3 (COC)
    public boolean naaccr00962(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] cT = new char[5]
        char[] pT = new char[5]
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010 || dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
        
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinT)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathT)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4"))) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3") || (functions.GEN_INLIST(untrimmedline.grade, "9") && !functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4") || (functions.GEN_INLIST(untrimmedline.grade, "9") && functions.GEN_INLIST(untrimmedline.gradePathValue, "4")))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            functions.GEN_STRCPY(pT, functions.GEN_SUBSTR(untrimmedline.tnmPathT, 2, 3))
        if (functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
            functions.GEN_STRCPY(pT, untrimmedline.tnmPathT)
        if (!functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            functions.GEN_STRCPY(cT, functions.GEN_SUBSTR(untrimmedline.tnmClinT, 2, 3))
        if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88"))
            functions.GEN_STRCPY(cT, untrimmedline.tnmClinT)
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTcode, cT)
        
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.NAACCR_AJC7TC, context.NAACCR_AJC7TC_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpTcode, pT)
        
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.NAACCR_AJC7TP, context.NAACCR_AJC7TP_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: NAACCR-00963; TAG: N2202; NAME: Primary Site, AJCC T - Ed 7, ICDO3 (NPCR)
    public boolean naaccr00963(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITELOW = new char[5], SITEHIGH = new char[5], GRP = new char[100], HISTLOW = new char[5], HISTHIGH = new char[5], GPCODE = new char[4], GRPTCODE = new char[100], SITEHIST = new char[100], SITEHISTLO = new char[100]
        
        int req_flag
        int dx_year
        
        char[] t_GrpTcode = new char[12]
        char[] SiteGrp = new char[5]
        char[] Site = new char[5]
        
        char[] GrpHist = new char[7]
        
        char[] t_SiteHist = new char[9]
        
        char[] Site_HistLo = new char[20]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2014 || dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3)) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.tnmEditionNumber, "07,88"))
            return true
        if (functions.GEN_AT(untrimmedline.overRideSiteTnmStggrp, "1") != 0) {
        
            if (functions.GEN_AT(untrimmedline.tnmEditionNumber, "88", 2) != 0 && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmClinT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmClinT)) && (functions.GEN_AT(functions.GEN_TRIM(untrimmedline.tnmPathT, ((Integer)context.NAACCR_GEN_RIGHT)), "88") != 0 || functions.GEN_EMPTY(untrimmedline.tnmPathT)))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'TNM Edition No/Stage values must be coded 88 if over-ride set for pediatric case')
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmClinT) && functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(Site, untrimmedline.primarySite)
        
        if (functions.GEN_RLOOKUP(Site, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITELOW, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0) {
                functions.GEN_STRCPY(Site_HistLo, SITELOW)
                functions.GEN_STRCAT(Site_HistLo, SITEHIGH)
                functions.GEN_STRCAT(Site_HistLo, untrimmedline.histologicTypeIcdO3)
        
                if (functions.GEN_RLOOKUP(Site_HistLo, context.NAACCR_AJC7SIGP, context.NAACCR_AJC7SIGP_SITEHISTLO, ['GPCODE':GPCODE, 'SITELOW':SITELOW, 'SITEHIGH':SITEHIGH, 'HISTLOW':HISTLOW, 'HISTHIGH':HISTHIGH, 'SITEHISTLO':SITEHISTLO])) {
                    if (functions.GEN_STRCMP(untrimmedline.primarySite, SITELOW) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, SITEHIGH) <= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTLOW) >= 0 && functions.GEN_STRCMP(untrimmedline.histologicTypeIcdO3, HISTHIGH) <= 0)
                        functions.GEN_STRCPY(SiteGrp, GPCODE)
                    else
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
                else
                    functions.GEN_STRCPY(SiteGrp, "999")
            }
            else
                functions.GEN_STRCPY(SiteGrp, "999")
        }
        else {
            functions.GEN_STRCPY(SiteGrp, "999")
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "000-419,422-423,425-440,442-689,691-694,698-809", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729,9735,9737-9738,9811-9818,9823,9827,9837"))
            functions.GEN_STRCPY(SiteGrp, "57A")
        else {
            if (functions.GEN_INLIST(SiteGrp, "04C")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                    functions.GEN_STRCPY(SiteGrp, "04D")
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010"))
                        functions.GEN_STRCPY(SiteGrp, "999")
                }
            }
            else {
                if (functions.GEN_INLIST(SiteGrp, "008")) {
        
                    if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9")) {
                        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "000-044"))
                            functions.GEN_STRCPY(SiteGrp, "08A")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "045-998"))
                                functions.GEN_STRCPY(SiteGrp, "08B")
                            else
                                functions.GEN_STRCPY(SiteGrp, "08C")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                            functions.GEN_STRCPY(SiteGrp, "08F")
                        else
                            functions.GEN_STRCPY(SiteGrp, "999")
                    }
                }
                else {
                    if (functions.GEN_INLIST(SiteGrp, "08D")) {
                        if (functions.GEN_INLIST(untrimmedline.grade, "1-3,9"))
                            functions.GEN_STRCPY(SiteGrp, "08D")
                        else {
                            if (functions.GEN_INLIST(untrimmedline.grade, "4"))
                                functions.GEN_STRCPY(SiteGrp, "08F")
                            else
                                functions.GEN_STRCPY(SiteGrp, "999")
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(SiteGrp, "011")) {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                functions.GEN_STRCPY(SiteGrp, "10B")
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "161-162", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8982-8990") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020,040,060"))
                                    functions.GEN_STRCPY(SiteGrp, "999")
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(SiteGrp, "16B")) {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "480-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "020"))
                                    functions.GEN_STRCPY(SiteGrp, "16A")
                            }
                            else {
                                if (functions.GEN_INLIST(SiteGrp, "021")) {
                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "240", "(C\\d\\d\\d)", 2, 3)) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "030"))
                                            functions.GEN_STRCPY(SiteGrp, "020")
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "040,070"))
                                                functions.GEN_STRCPY(SiteGrp, "022")
                                        }
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(SiteGrp, "37B")) {
                                        if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3)) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                                                functions.GEN_STRCPY(SiteGrp, "999")
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(SiteGrp, "046")) {
                                            if (functions.GEN_INLIST(untrimmedline.sex, "2"))
                                                functions.GEN_STRCPY(SiteGrp, "46A")
                                            else
                                                functions.GEN_STRCPY(SiteGrp, "46B")
                                        }
                                        else {
                                            if (functions.GEN_INLIST(SiteGrp, "051")) {
                                                if (functions.GEN_INLIST(untrimmedline.primarySite, "693", "(C\\d\\d\\d)", 2, 3))
                                                    functions.GEN_STRCPY(SiteGrp, "51A")
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.primarySite, "694", "(C\\d\\d\\d)", 2, 3)) {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "010,999"))
                                                            functions.GEN_STRCPY(SiteGrp, "51A")
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "020"))
                                                                functions.GEN_STRCPY(SiteGrp, "51B")
                                                            else
                                                                functions.GEN_STRCPY(SiteGrp, "999")
                                                        }
                                                    }
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(SiteGrp, "053")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "015"))
                                                        functions.GEN_STRCPY(SiteGrp, "999")
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "999")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "739", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8940-8950, 8980-8981") && functions.GEN_INLIST(untrimmedline.grade, "4"))
                functions.GEN_STRCPY(SiteGrp, "08F")
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820,8823-8934,8940-9136,9142-9582") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                    functions.GEN_STRCPY(SiteGrp, "028")
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "481-488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8800-8820, 8823-8921,9120-9136,9142-9582") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002"))
                        functions.GEN_STRCPY(SiteGrp, "028")
                }
            }
        }
        if (functions.GEN_INLIST(SiteGrp, "028,37B") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9050-9055")) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.tnmClinT)) {
            functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
            functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmClinT)
        
            if (!functions.GEN_LOOKUP(t_GrpTcode, context.NAACCR_AJC7TC, context.NAACCR_AJC7TC_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
                if (functions.GEN_INLIST(SiteGrp, "999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code should = "88" for site/hist combination')
                else
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Clin T code is invalid for site/hist combination')
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.tnmPathT))
            return true
        functions.GEN_STRCPY(t_GrpTcode, SiteGrp)
        
        functions.GEN_STRCAT(t_GrpTcode, untrimmedline.tnmPathT)
        
        if (!functions.GEN_LOOKUP(t_GrpTcode, context.NAACCR_AJC7TP, context.NAACCR_AJC7TP_GRPTCODE, ['GRPTCODE':GRPTCODE])) {
            if (functions.GEN_INLIST(SiteGrp, "999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code should = "88" for site/hist combination')
            else
                functions.GEN_SAVE_ERROR_TEXT(binding, 'TNM Path T code is invalid for site/hist combination')
        }
        return true

    }

    // ID: NAACCR-00964; TAG: N0008; NAME: Primary Site, Behavior Code ICDO2 (SEER IF39)
    public boolean naaccr00964(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000)
            return true
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteBehavior, "(1)"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.behaviorIcdO2, "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: NAACCR-00965; TAG: N0476; NAME: Primary Site, Behavior Code ICDO3 (SEER IF39)
    public boolean naaccr00965(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: NAACCR-00966; TAG: N0851; NAME: Primary Site, CS Extension (SEER IF176)
    public boolean naaccr00966(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteEodDxDt, "(1)"))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140, 9590-9992"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-300") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "069,260-269,390-399,409,419,579,639", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-320") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "479,499", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-400") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "C189") && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8220,8261,8263")) || functions.GEN_INLIST(untrimmedline.primarySite, "559", "(C\\d\\d\\d)", 2, 3))
                return false
        }
        return true

    }

    // ID: NAACCR-00967; TAG: N0464; NAME: Primary Site, EOD, ICDO3 (SEER IF40)
    public boolean naaccr00967(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_MATCH(untrimmedline.overRideSiteEodDxDt, "(1)"))
            return true
        if (functions.GEN_VAL(untrimmedline.behaviorCodeIcdO3) == 2)
            return true
        if ((functions.GEN_VAL(untrimmedline.codingSystemForEod) == 4 && functions.GEN_VAL(untrimmedline.histologicTypeIcdO3) == 9140) || functions.GEN_VAL(untrimmedline.histologicTypeIcdO3) >= 9590)
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "C189") && !(functions.GEN_MATCH(untrimmedline.histologicTypeIcdO3, "(8210)|(8220)|(8261)|(8263)"))) {
            if ((functions.GEN_VAL(untrimmedline.codingSystemForEod) == 0 || functions.GEN_VAL(untrimmedline.codingSystemForEod) == 1) && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "4-") == 0)
                return false
            else {
                if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 3 && (functions.GEN_STRCMP(functions.GEN_RIGHT(functions.GEN_LEFT(untrimmedline.eodOld4Digit, 3), 1), "4", 1) < 0 && functions.GEN_STRCMP(functions.GEN_RIGHT(functions.GEN_LEFT(untrimmedline.eodOld4Digit, 3), 1), "0", 1) > 0))
                    return false
                else {
                    if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 4 && (functions.GEN_VAL(untrimmedline.eodExtension) >= 10 && functions.GEN_VAL(untrimmedline.eodExtension) < 31))
                        return false
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 0 || functions.GEN_VAL(untrimmedline.codingSystemForEod) == 1) {
            if ((functions.GEN_MATCH(untrimmedline.primarySite, "(C069)|(C26[0-9])|(C39[0-9])|(C409)|(C419)|(C479)|(C499)|(C559)|(C579)|(C639)|(C76[0-8])|(C809)") && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "4-", 2) == 0) || (functions.GEN_MATCH(untrimmedline.primarySite, "(C76[0-8])|(C809)") && functions.GEN_STRCMP(untrimmedline.eodOld2Digit, "5-", 2) == 0))
                return false
        }
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 3 && functions.GEN_MATCH(untrimmedline.primarySite, "(C069)|(C26[0-9])|(C39[0-9])|(C409)|(C419)|(C479)|(C499)|(C559)|(C579)|(C639)|(C76[0-8])|(C809)") && (functions.GEN_STRCMP(functions.GEN_LEFT(functions.GEN_RIGHT(untrimmedline.eodOld4Digit, 2), 1), "4", 1) < 0 && functions.GEN_STRCMP(functions.GEN_LEFT(functions.GEN_RIGHT(untrimmedline.eodOld4Digit, 2), 1), "0", 1) > 0))
            return false
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 4) {
            if (functions.GEN_MATCH(untrimmedline.primarySite, "(C069)|(C26[0-9])|(C39[0-9])|(C409)|(C419)|(C479)|(C499)|(C559)|(C579)|(C639)|(C76[0-8])|(C809)") && (functions.GEN_VAL(untrimmedline.eodExtension) > 9 && functions.GEN_VAL(untrimmedline.eodExtension) < 31))
                return false
        }
        return true

    }

    // ID: NAACCR-00969; TAG: N0390; NAME: Primary Site, Laterality (SEER IF82)
    public boolean naaccr00969(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.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2006) {
            if (functions.GEN_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: NAACCR-00970; TAG: N0864; NAME: Primary Site, Laterality, CS Extension (SEER IF177)
    public boolean naaccr00970(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_MATCH(untrimmedline.overRideSiteLatEod, "(1)"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if ((dx_year == 2016 || dx_year == 2017) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140, 9590-9992"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "079-081,090,091,098,099,301,310,312,341-349", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "384,400-403,441,442,446,447,471,472,491,492", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "500-509,569,570,620-631,649,659,669,690-699", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740-749,754", "(C\\d\\d\\d)", 2, 3))
            functions.GEN_NOOP()
        else
            return true
        if (functions.GEN_INLIST(untrimmedline.laterality, "9")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "000-100"))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3)) {
                    if (functions.GEN_INLIST(untrimmedline.csExtension, "000-310"))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "471,472,491,492", "(C\\d\\d\\d)", 2, 3)) {
                        if (functions.GEN_INLIST(untrimmedline.csExtension, "000-320"))
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3)) {
                            if (functions.GEN_INLIST(untrimmedline.csExtension, "000-400"))
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csExtension, "000-300"))
                                return false
                        }
                    }
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.laterality, "4")) {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "090,091,098,099,569,570,649,692", "(C\\d\\d\\d)", 2, 3))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.primarySite, "500-509", "(C\\d\\d\\d)", 2, 3)) {
                        if (functions.GEN_INLIST(untrimmedline.csExtension, "000-100"))
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.primarySite, "620-629", "(C\\d\\d\\d)", 2, 3)) {
                            if (functions.GEN_INLIST(untrimmedline.csExtension, "000-310"))
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.primarySite, "471,472,491,492", "(C\\d\\d\\d)", 2, 3)) {
                                if (functions.GEN_INLIST(untrimmedline.csExtension, "000-320"))
                                    return false
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3)) {
                                    if (functions.GEN_INLIST(untrimmedline.csExtension, "000-400"))
                                        return false
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csExtension, "000-300")) {
                                        if (dx_year > 2009) {
                                            if (functions.GEN_INLIST(untrimmedline.primarySite, "340-349", "(C\\d\\d\\d)", 2, 3)) {
                                                if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "23,25,26,36,38,40,41,42,43,50,51,52,53,70,75"))
                                                    return true
                                                else
                                                    return false
                                            }
                                            else
                                                return false
                                        }
                                        else
                                            return false
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00971; TAG: N0465; NAME: Primary Site, Laterality, EOD, ICDO3 (SEER IF41)
    public boolean naaccr00971(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))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteLatEod, "(1)"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2003)
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9989"))
            return true
        if (dx_year > 1987) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9140"))
                return true
        }
        if (functions.GEN_MATCH(untrimmedline.primarySite, "(C079)|(C080)|(C091)|(C098)|(C099)|(C301)|(C310)|(C312)|(C34[1-9])|(C384)") || functions.GEN_MATCH(untrimmedline.primarySite, "(C50[0-9])|(C569)|(C570)|(C62[0-9])|(C63[0-1])|(C649)|(C659)|(C669)|(C69[0-9])|(C74[0-9])|(C754)") || (dx_year > 1978 && functions.GEN_MATCH(untrimmedline.primarySite, "(C081)|(C090)|(C40[0-3])|(C441)|(C442)|(C446)|(C447)|(C471)|(C472)|(C491)|(C492)")))
            functions.GEN_NOOP()
        else
            return true
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 0) {
            if (functions.GEN_VAL(untrimmedline.laterality) == 9 && functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(0\\-)|(4\\-)|(5\\-)"))
                return false
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "C569") || (functions.GEN_INLIST(untrimmedline.primarySite, "C649") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960-8960")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C692") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9512")))
                    return true
                else {
                    if (functions.GEN_VAL(untrimmedline.laterality) == 4 && functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(0\\-)|(4\\-)|(5\\-)"))
                        return false
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 1) {
            if (functions.GEN_VAL(untrimmedline.laterality) == 9 && functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(0.)|(1.)|(2.)|(3.)|(4.)"))
                return false
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "C569") || (functions.GEN_INLIST(untrimmedline.primarySite, "C649") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960-8960")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C692") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9512")))
                    return true
                else {
                    if (functions.GEN_VAL(untrimmedline.laterality) == 4 && functions.GEN_MATCH(untrimmedline.eodOld2Digit, "(0.)|(1.)|(2.)|(3.)|(4.)"))
                        return false
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 3) {
            if (functions.GEN_VAL(untrimmedline.laterality) == 9 && functions.GEN_MATCH(untrimmedline.eodOld4Digit, "(..0.)|(..1.)|(..2.)|(..3.)"))
                return false
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "C569") || (functions.GEN_INLIST(untrimmedline.primarySite, "C649") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960-8960")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C692") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9512")))
                    return true
                else {
                    if (functions.GEN_VAL(untrimmedline.laterality) == 4 && functions.GEN_MATCH(untrimmedline.eodOld4Digit, "(..0.)|(..1.)|(..2.)|(..3.)"))
                        return false
                }
            }
        }
        if (functions.GEN_VAL(untrimmedline.codingSystemForEod) == 4) {
            if (functions.GEN_VAL(untrimmedline.laterality) == 9 && ((functions.GEN_MATCH(untrimmedline.primarySite, "(C50[0-9])") && functions.GEN_VAL(untrimmedline.eodExtension) <= 19 && functions.GEN_VAL(untrimmedline.eodExtension) >= 0) || ((functions.GEN_MATCH(untrimmedline.primarySite, "(C079)|(C08[0-1])|(C090)|(C091)|(C098)|(C099)|(C301)|(C310)|(C312)|(C34[1-9])|(C384)|(C40[0-3])|(C471)") || functions.GEN_MATCH(untrimmedline.primarySite, "(C472)|(C491)|(C492)|(C569)|(C570)|(C62[0-9])") || functions.GEN_MATCH(untrimmedline.primarySite, "(C630)|(C631)|(C649)|(C659)|(C669)|(C69[0-9])|(C74[0-9])|(C754)")) && functions.GEN_VAL(untrimmedline.eodExtension) <= 30 && functions.GEN_VAL(untrimmedline.eodExtension) >= 0) || (functions.GEN_MATCH(untrimmedline.primarySite, "(C441)|(C442)|(C446)|(C447)") && functions.GEN_VAL(untrimmedline.eodExtension) <= 40 && functions.GEN_VAL(untrimmedline.eodExtension) >= 0)))
                return false
            else {
                if (functions.GEN_INLIST(untrimmedline.primarySite, "C090,C091,C098,C099,C569") || (functions.GEN_INLIST(untrimmedline.primarySite, "C649") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8960-8960")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C692") && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9510-9514")))
                    return true
                else {
                    if (functions.GEN_VAL(untrimmedline.laterality) == 4 && ((functions.GEN_MATCH(untrimmedline.primarySite, "(C50[0-9])") && functions.GEN_VAL(untrimmedline.eodExtension) <= 19 && functions.GEN_VAL(untrimmedline.eodExtension) >= 0) || ((functions.GEN_MATCH(untrimmedline.primarySite, "(C079)|(C08[0-1])|(C09[0-1])|(C098)|(C099)|(C301)|(C310)|(C312)|(C34[1-9])|(C384)") || functions.GEN_MATCH(untrimmedline.primarySite, "(C40[0-3])|(C471)|(C472)|(C491)|(C492)|(C569)|(C570)|(C62[0-9])|(C630)|(C631)") || functions.GEN_MATCH(untrimmedline.primarySite, "(C649)|(C659)|(C669)|(C69[0-9])|(C74[0-9])|(C754)")) && functions.GEN_VAL(untrimmedline.eodExtension) <= 30 && functions.GEN_VAL(untrimmedline.eodExtension) >= 0) || (functions.GEN_MATCH(untrimmedline.primarySite, "(C441)|(C442)|(C446)|(C447)") && functions.GEN_VAL(untrimmedline.eodExtension) <= 40 && functions.GEN_VAL(untrimmedline.eodExtension) >= 0)))
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-00972; TAG: N0009; NAME: Primary Site, Morphology-Imposs ICDO2 (SEER IF38)
    public boolean naaccr00972(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year /* Declare variables in table to be referenced in edit */
        char[] site = new char[5], histlo = new char[5], histhi = new char[5] /* Declare concatenated Site/Histology variable */
        char[] SiteHist = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000) {
            return true
        }
        functions.GEN_STRCPY(SiteHist, untrimmedline.primarySite)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologyIcdO2)
        
        if (functions.GEN_RLOOKUP(SiteHist, context.NAACCR_IF38IMPO, context.NAACCR_IF38IMPO_SITEHISTLO, ['SITE':site, 'HISTLO':histlo, 'HISTHI':histhi])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, site) == 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, histlo) >= 0 && functions.GEN_STRCMP(untrimmedline.histologyIcdO2, histhi) <= 0)
                return false
        }
        
        return true

    }

    // ID: NAACCR-00973; TAG: N0446; NAME: Primary Site, Morphology-Imposs ICDO3 (SEER IF38)
    public boolean naaccr00973(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.NAACCR_IF38IM01, context.NAACCR_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: NAACCR-00974; TAG: N0383; NAME: Primary Site, Morphology-Type ICDO2 (COC)
    public boolean naaccr00974(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], SitHist = new char[100]
        
        char[] SiteHist = new char[9]
        
        char[] SiteGrp = new char[5]
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8000-8004,8010-8045,8050-8082,8090-8110")) {
            return true
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_IF25_REF, context.NAACCR_IF25_REF_SITE_LO, ['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(SiteHist, SiteGrp)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologyIcdO2, 4)
        
        return functions.GEN_ILOOKUP(SiteHist, context.NAACCR_IF25_2, context.NAACCR_IF25_2_SITEHIST, [:])

    }

    // ID: NAACCR-00975; TAG: N0010; NAME: Primary Site, Morphology-Type ICDO2 (SEER IF25)
    public boolean naaccr00975(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], SitHist = new char[100]
        
        char[] SiteHist = new char[9]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)")) {
            return true
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_IF25_REF, context.NAACCR_IF25_REF_SITE_LO, ['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(SiteHist, SiteGrp)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologyIcdO2, 4)
        
        return functions.GEN_ILOOKUP(SiteHist, context.NAACCR_IF25_2, context.NAACCR_IF25_2_SITEHIST, [:])

    }

    // ID: NAACCR-00976; TAG: N0455; NAME: Primary Site, Morphology-Type ICDO3 (COC)
    public boolean naaccr00976(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITE_LO = new char[5], SITE_HI = new char[5], SITE = new char[5], HIST = new char[5]
        int dx_year
        
        char[] SiteHist = new char[10]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if ((dx_year != ((Integer)context.NAACCR_GEN_DT_EMPTY)) && (dx_year > 2008))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8005,8010-8046,8050-8084,8090-8110")) {
            return true
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_IF25_REF, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_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(SiteHist, SiteGrp)
        functions.GEN_STRCAT(SiteHist, untrimmedline.histologicTypeIcdO3, 4)
        
        if (functions.GEN_SQLLOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_IF25_3, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_IF25_3_SITEHIST, SiteHist, ['SITE':SITE, 'HIST':HIST]))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00977; TAG: N1032; NAME: Primary Site, Morphology-Type, Beh ICDO3 (COC)
    public boolean naaccr00977(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] SITE_LO = new char[5], SITE_HI = new char[5], SITE = new char[5], HIST = new char[5], BEH = new char[2]
        int dx_year
        
        char[] SiteHistBeh = new char[11]
        
        char[] SiteGrp = new char[5]
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2009)
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideCocSiteType, "(1)"))
            return true
        if (functions.GEN_MATCH(untrimmedline.overRideSiteType, "(1)"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "440-449", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8005,8010-8046,8050-8084,8090-8110") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
            return true
        }
        if (functions.GEN_SQLRANGELOOKUP((com.imsweb.validation.entities.ContextTable)context.NAACCR_IF25_REF, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_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.NAACCR_IF25_3, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_IF25_3_SITEHISTBEH, SiteHistBeh, ['SITE':SITE, 'HIST':HIST, 'BEH':BEH]))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00978; TAG: N1254; NAME: Primary Site, Morphology-Type, Beh ICDO3 (SEER IF25)
    public boolean naaccr00978(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.NAACCR_IF25_REF, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_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.NAACCR_IF25_3, (com.imsweb.validation.entities.ContextTableIndex)context.NAACCR_IF25_3_SITEHISTBEH, SiteHistBeh, ['SITE':SITE, 'HIST':HIST, 'BEH':BEH]))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00979; TAG: N0384; NAME: Primary Site, No AJCC Scheme-Ed 5, ICDO2 (NAACCR)
    public boolean naaccr00979(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998 || (dx_year > 2002))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologyIcdO2))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "9590-9698,9702-9717"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,300,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "691,699,700-701,709-719,720-725,728,729", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750-755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00980; TAG: N0456; NAME: Primary Site, No AJCC Scheme-Ed 5, ICDO3 (NAACCR)
    public boolean naaccr00980(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 1998 || (dx_year > 2002))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9699,9702-9729"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "173,254,260,268,269,300,301,312", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "313,318,319,339,379,390,398,399", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "420-424,571-574,577-579,630,631,637-639", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "691,699,700-701,709-719,720-725,728,729", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "740,741,749,750-755,758,759,760-765", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.primarySite, "767,768,809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.tnmClinT, "88") && functions.GEN_INLIST(untrimmedline.tnmPathT, "88") && functions.GEN_INLIST(untrimmedline.tnmClinN, "88") && functions.GEN_INLIST(untrimmedline.tnmPathN, "88") && functions.GEN_INLIST(untrimmedline.tnmClinM, "88") && functions.GEN_INLIST(untrimmedline.tnmPathM, "88") && functions.GEN_INLIST(untrimmedline.tnmClinStageGroup, "88") && functions.GEN_INLIST(untrimmedline.tnmPathStageGroup, "88"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00981; TAG: N0585; NAME: RX Coding System--Current (COC)
    public boolean naaccr00981(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxCodingSystemCurrent, "08", "(\\d\\d)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00982; TAG: N0070; NAME: RX Coding System--Current (NAACCR)
    public boolean naaccr00982(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxCodingSystemCurrent, "00-08,99", "(\\d\\d)")

    }

    // ID: NAACCR-00983; TAG: N0071; NAME: RX Date BRM (COC)
    public boolean naaccr00983(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-00984; TAG: N1071; NAME: RX Date BRM Flag (NAACCR)
    public boolean naaccr00984(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00985; TAG: N1122; NAME: RX Date BRM, Date Flag (COC)
    public boolean naaccr00985(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10,11,12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = blank, 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-00986; TAG: N1123; NAME: RX Date BRM, Date Flag (NAACCR)
    public boolean naaccr00986(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10-12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date BRM is blank, RX Date BRM Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date BRM is present, corresponding date flag must be blank')
        }
        return true

    }

    // ID: NAACCR-00987; TAG: N1426; NAME: RX Date BRM, Date Flag, DX Date (NPCR)
    public boolean naaccr00987(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date BRM and RX Date BRM Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-00988; TAG: N1126; NAME: RX Date BRM, Date Flag, Date DX (COC)
    public boolean naaccr00988(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is less than 2003, RX Date BRM and RX Date BRM Flag cannot both be blank')
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is greater than 2009, RX Date BRM and RX Date BRM Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-00989; TAG: N1386; NAME: RX Date BRM, Date Last Contact (COC)
    public boolean naaccr00989(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-00990; TAG: N1530; NAME: RX Date BRM, Date of Diagnosis (COC)
    public boolean naaccr00990(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-00991; TAG: N1428; NAME: RX Date BRM, RX Date Systemic (COC)
    public boolean naaccr00991(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) || functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateBrm, untrimmedline.rxDateSystemic, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-00992; TAG: N1046; NAME: RX Date Chemo (COC)
    public boolean naaccr00992(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-00993; TAG: N1121; NAME: RX Date Chemo Flag (NAACCR)
    public boolean naaccr00993(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00994; TAG: N1113; NAME: RX Date Chemo, Date Flag (COC)
    public boolean naaccr00994(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10,11,12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = blank, 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-00995; TAG: N1047; NAME: RX Date Chemo, Date Flag (NAACCR)
    public boolean naaccr00995(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10-12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Chemo is blank, RX Date Chemo Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Chemo is present, corresponding date flag must be blank')
        }
        return true

    }

    // ID: NAACCR-00996; TAG: N1425; NAME: RX Date Chemo, Date Flag, DX Date (NPCR)
    public boolean naaccr00996(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Chemo and RX Date Chemo Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-00997; TAG: N1114; NAME: RX Date Chemo, Date Flag, Date DX (COC)
    public boolean naaccr00997(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is less than 2003, RX Date Chemo and RX Date Chemo Flag cannot both be blank')
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is greater than 2009, RX Date Chemo and RX Date Chemo Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-00998; TAG: N1384; NAME: RX Date Chemo, Date Last Contact (COC)
    public boolean naaccr00998(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-00999; TAG: N1531; NAME: RX Date Chemo, Date of Diagnosis (COC)
    public boolean naaccr00999(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01000; TAG: N1429; NAME: RX Date Chemo, RX Date Systemic (COC)
    public boolean naaccr01000(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) || functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateChemo, untrimmedline.rxDateSystemic, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01001; TAG: N0171; NAME: RX Date DX/Stg Proc (COC)
    public boolean naaccr01001(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateDxStgProc))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date DX/Stg Proc: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-01002; TAG: N1105; NAME: RX Date DX/Stg Proc, Date Flag (COC)
    public boolean naaccr01002(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date DX/Stg Proc is blank, corresponding RX Date Dx/Stg Proc Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateDxStgProcFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01003; TAG: N0867; NAME: RX Date DX/Stg Proc, Date Last Contact (COC)
    public boolean naaccr01003(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastContact, untrimmedline.rxDateDxStgProc, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateDxStgProc))
                functions.GEN_ERROR_TEXT(binding, 'RX Date DX/Stg Proc is invalid: %DC')
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact))
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
            }
            return false
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01004; TAG: N1084; NAME: RX Date Dx/Stg Proc Flag (NAACCR)
    public boolean naaccr01004(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateDxStgProcFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01005; TAG: N0073; NAME: RX Date Hormone (COC)
    public boolean naaccr01005(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-01006; TAG: N1072; NAME: RX Date Hormone Flag (NAACCR)
    public boolean naaccr01006(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01007; TAG: N1124; NAME: RX Date Hormone, Date Flag (COC)
    public boolean naaccr01007(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10,11,12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If date is blank, corresponding flag must = blank, 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01008; TAG: N1125; NAME: RX Date Hormone, Date Flag (NAACCR)
    public boolean naaccr01008(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateHormoneFlag, "10-12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Hormone is blank, RX Date Hormone Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Hormone is present, corresponding date flag must be blank')
        }
        return true

    }

    // ID: NAACCR-01009; TAG: N1427; NAME: RX Date Hormone, Date Flag, DX Date (NPCR)
    public boolean naaccr01009(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Hormone and RX Date Hormone Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-01010; TAG: N1127; NAME: RX Date Hormone, Date Flag, Date DX (COC)
    public boolean naaccr01010(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2003) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is less than 2003, RX Date Hormone and RX Date Hormone Flag cannot both be blank')
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) && functions.GEN_EMPTY(untrimmedline.rxDateHormoneFlag))
                return functions.GEN_ERROR_MSG(binding, 'If Date of Diagnosis is greater than 2009, RX Date Hormone and RX Date Hormone Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-01011; TAG: N1385; NAME: RX Date Hormone, Date Last Contact (COC)
    public boolean naaccr01011(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01012; TAG: N1532; NAME: RX Date Hormone, Date of Diagnosis (COC)
    public boolean naaccr01012(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01013; TAG: N1430; NAME: RX Date Hormone, RX Date Systemic (COC)
    public boolean naaccr01013(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateHormone) || functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateHormone, untrimmedline.rxDateSystemic, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01014; TAG: N0510; NAME: RX Date Mst Defn Srg (COC)
    public boolean naaccr01014(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-01015; TAG: N1092; NAME: RX Date Mst Defn Srg Flag (NAACCR)
    public boolean naaccr01015(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01016; TAG: N1111; NAME: RX Date Mst Defn Srg, Date Flag (NAACCR)
    public boolean naaccr01016(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateMostDefinSurgFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Mst Defn Srg is blank, corresponding RX Date Mst Defn Srg Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01017; TAG: N1112; NAME: RX Date Mst Defn Srg, Date Flag, DX Date (COC)
    public boolean naaccr01017(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) && functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurgFlag))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01018; TAG: N0525; NAME: RX Date Mst Defn Srg, Date Last Contact (COC)
    public boolean naaccr01018(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01019; TAG: N0511; NAME: RX Date Mst Defn Srg, Date of DX (COC)
    public boolean naaccr01019(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01020; TAG: N0531; NAME: RX Date Mst Defn Srg, RX Date Surgery (COC)
    public boolean naaccr01020(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) || functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateMostDefinSurg, untrimmedline.rxDateSurgery, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01021; TAG: N0529; NAME: RX Date Mst Defn Srg, Surg Prim Site (COC)
    public boolean naaccr01021(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "009899", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
                return false
        }
        return true

    }

    // ID: NAACCR-01022; TAG: N0074; NAME: RX Date Other (COC)
    public boolean naaccr01022(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-01023; TAG: N1085; NAME: RX Date Other Flag (NAACCR)
    public boolean naaccr01023(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01024; TAG: N1106; NAME: RX Date Other, Date Flag (NAACCR)
    public boolean naaccr01024(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateOtherFlag, "10,11,12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Other is blank, RX Date Other Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01025; TAG: N1107; NAME: RX Date Other, Date Flag, DX Date (COC)
    public boolean naaccr01025(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01026; TAG: N1424; NAME: RX Date Other, Date Flag, DX Date (NPCR)
    public boolean naaccr01026(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateOther) && functions.GEN_EMPTY(untrimmedline.rxDateOtherFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Other and RX Date Other Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-01027; TAG: N0868; NAME: RX Date Other, Date Last Contact (COC)
    public boolean naaccr01027(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateOther))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01028; TAG: N1533; NAME: RX Date Other, Date of Diagnosis (COC)
    public boolean naaccr01028(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateOther) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateOther, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01029; TAG: N0523; NAME: RX Date Rad Ended (COC)
    public boolean naaccr01029(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiationEnded))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation Ended: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-01030; TAG: N1074; NAME: RX Date Rad Ended Flag (NAACCR)
    public boolean naaccr01030(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01031; TAG: N1129; NAME: RX Date Rad Ended, Date Flag (NAACCR)
    public boolean naaccr01031(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateRadiationEndedFlag, "10-12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended is blank, RX Date Rad Ended Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEndedFlag))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Rad Ended is present, corresponding date flag must be blank')
        }
        return true

    }

    // ID: NAACCR-01032; TAG: N0526; NAME: RX Date Rad Ended, Date Last Contact (COC)
    public boolean naaccr01032(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiationEnded, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateRadiationEnded)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation Ended is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01033; TAG: N2034; NAME: RX Date Rad Ended, RX Date Radiation (COC)
    public boolean naaccr01033(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.rxDateRadiationEnded, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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.rxDateRadiationEnded)) {
                    functions.GEN_ERROR_TEXT(binding, 'RX Date Radiation Ended is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01034; TAG: N0586; NAME: RX Date Rad Ended, Rad--Location of RX (COC)
    public boolean naaccr01034(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01035; TAG: N1229; NAME: RX Date Rad Ended, Rad--No of Treatment Vol (COC)
    public boolean naaccr01035(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.radNoOfTreatmentVol, "000") != 0)
                return false
        }
        
        return true

    }

    // ID: NAACCR-01036; TAG: N0588; NAME: RX Date Rad Ended, Rad--Regional Dose: cGy (COC)
    public boolean naaccr01036(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.radRegionalDoseCgy, "00000") != 0)
                return false
        }
        
        return true

    }

    // ID: NAACCR-01037; TAG: N0589; NAME: RX Date Rad Ended, Rad--Regional RX Modality (COC)
    public boolean naaccr01037(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.radRegionalRxModality, "00") != 0)
                return false
        }
        
        return true

    }

    // ID: NAACCR-01038; TAG: N0590; NAME: RX Date Rad Ended, Rad--Treatment Volume (COC)
    public boolean naaccr01038(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radTreatmentVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationEnded)) {
            if (functions.GEN_AT(untrimmedline.radTreatmentVolume, "00") != 0)
                return false
        }
        
        return true

    }

    // ID: NAACCR-01039; TAG: N0549; NAME: RX Date Radiation (COC)
    public boolean naaccr01039(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-01040; TAG: N1073; NAME: RX Date Radiation Flag (NAACCR)
    public boolean naaccr01040(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01041; TAG: N1128; NAME: RX Date Radiation, Date Flag (COC)
    public boolean naaccr01041(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "10-12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation is blank, RX Date Radiation Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Radiation is present, corresponding date flag must be blank')
        }
        return true

    }

    // ID: NAACCR-01042; TAG: N1602; NAME: RX Date Radiation, Date Flag, DX Date (NPCR)
    public boolean naaccr01042(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return true
        }
        if (dx_year < 2011) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return false
        }
        else {
            if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Date Radiation and RX Date Radiation Flag cannot both be blank')
        }
        
        return true

    }

    // ID: NAACCR-01043; TAG: N1383; NAME: RX Date Radiation, Date Last Contact (COC)
    public boolean naaccr01043(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01044; TAG: N1534; NAME: RX Date Radiation, Date of Diagnosis (COC)
    public boolean naaccr01044(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateRadiation, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01045; TAG: N0573; NAME: RX Date Radiation, Rad--Boost Dose cGy (NAACCR)
    public boolean naaccr01045(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radBoostDoseCgy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radBoostDoseCgy, "00000"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01046; TAG: N0572; NAME: RX Date Radiation, Rad--Boost RX Modality (NAACCR)
    public boolean naaccr01046(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radBoostRxModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation) && functions.GEN_EMPTY(untrimmedline.rxDateRadiationFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateRadiationFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.radBoostRxModality, "00"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01047; TAG: N0535; NAME: RX Date Radiation, Rad--Location of RX (COC)
    public boolean naaccr01047(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radLocationOfRx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_AT(untrimmedline.radLocationOfRx, "0") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01048; TAG: N0569; NAME: RX Date Radiation, Rad--No of Treatment Vol (COC)
    public boolean naaccr01048(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radNoOfTreatmentVol))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_AT(untrimmedline.radNoOfTreatmentVol, "000") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01049; TAG: N0571; NAME: RX Date Radiation, Rad--Regional Dose: cGy (COC)
    public boolean naaccr01049(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalDoseCgy))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_AT(untrimmedline.radRegionalDoseCgy, "00000") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01050; TAG: N0570; NAME: RX Date Radiation, Rad--Regional RX Modality (COC)
    public boolean naaccr01050(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radRegionalRxModality))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_AT(untrimmedline.radRegionalRxModality, "00") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01051; TAG: N0568; NAME: RX Date Radiation, Rad--Treatment Volume (COC)
    public boolean naaccr01051(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.radTreatmentVolume))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateRadiation))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.rxDateRadiation)) {
            if (functions.GEN_AT(untrimmedline.radTreatmentVolume, "00") != 0)
                return false
        }
        return true

    }

    // ID: NAACCR-01052; TAG: N0521; NAME: RX Date Surg Disch (COC)
    public boolean naaccr01052(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgicalDisch))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Surgical Disch: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-01053; TAG: N1087; NAME: RX Date Surg Disch Flag (NAACCR)
    public boolean naaccr01053(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01054; TAG: N1109; NAME: RX Date Surg Disch, Date Flag (NAACCR)
    public boolean naaccr01054(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) && functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateSurgicalDischFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Surg Disch is blank, corresponding RX Date Surg Disch Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01055; TAG: N1110; NAME: RX Date Surg Disch, Date Flag, DX Date (COC)
    public boolean naaccr01055(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) && functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDischFlag))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01056; TAG: N0527; NAME: RX Date Surg Disch, Date Last Contact (COC)
    public boolean naaccr01056(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) || functions.GEN_EMPTY(untrimmedline.dateOfLastContact))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgicalDisch, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgicalDisch)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgical Disch is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact)) {
                    functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp <= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01057; TAG: N0533; NAME: RX Date Surg Disch, Date Mst Defn Srg (COC)
    public boolean naaccr01057(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateMostDefinSurg))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgicalDisch, untrimmedline.rxDateMostDefinSurg, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgicalDisch)) {
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgical Disch is invalid: %DC')
                return false
            }
            else {
                if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateMostDefinSurg)) {
                    functions.GEN_ERROR_TEXT(binding, 'RX Date Most Defin Surg Ended is invalid: %DC')
                    return false
                }
            }
        }
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01058; TAG: N0522; NAME: RX Date Surg Disch, Date of DX (COC)
    public boolean naaccr01058(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgicalDisch, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSurgicalDisch))
                functions.GEN_ERROR_TEXT(binding, 'RX Date Surgical Disch 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: NAACCR-01059; TAG: N0532; NAME: RX Date Surg Disch, Surg Prim Site (COC)
    public boolean naaccr01059(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch))
            return true
        if (functions.GEN_AT(untrimmedline.rxSummSurgPrimSite, "009899", 2) != 0) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgicalDisch))
                return false
        }
        return true

    }

    // ID: NAACCR-01060; TAG: N0356; NAME: RX Date Surgery (COC)
    public boolean naaccr01060(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        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: NAACCR-01061; TAG: N1086; NAME: RX Date Surgery Flag (NAACCR)
    public boolean naaccr01061(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10,11,12"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01062; TAG: N1108; NAME: RX Date Surgery, Date Flag (COC)
    public boolean naaccr01062(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateSurgeryFlag, "10,11,12"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Surgery is blank, corresponding RX Date Surgery Flag must = 10, 11, or 12')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
                return functions.GEN_ERROR_MSG(binding, 'Either date or corresponding date flag must be blank if other is present')
        }
        return true

    }

    // ID: NAACCR-01063; TAG: N1422; NAME: RX Date Surgery, Date Flag, DX Date (NPCR)
    public boolean naaccr01063(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year > 2010) {
            if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) && functions.GEN_EMPTY(untrimmedline.rxDateSurgeryFlag))
                return false
        }
        
        return true

    }

    // ID: NAACCR-01064; TAG: N0869; NAME: RX Date Surgery, Date Last Contact (COC)
    public boolean naaccr01064(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.dateOfLastContact) || functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOfLastContact, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_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: NAACCR-01065; TAG: N1535; NAME: RX Date Surgery, Date of Diagnosis (COC)
    public boolean naaccr01065(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.rxDateSurgery, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        else {
            if (dtcmp >= 0)
                return true
            else
                return false
        }
        
        return true

    }

    // ID: NAACCR-01066; TAG: N0391; NAME: RX Date Surgery, RX Text--Surgery (NAACCR)
    public boolean naaccr01066(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSurgery))
            return true
        if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextSurgery, 1, 79)))
            return false
        
        return true

    }

    // ID: NAACCR-01067; TAG: N0567; NAME: RX Date Systemic (COC)
    public boolean naaccr01067(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
            return true
        if (functions.GEN_VALID_DATE_IOP(binding, untrimmedline.rxDateSystemic))
            return true
        else {
            functions.GEN_ERROR_TEXT(binding, 'RX Date Systemic: %DC')
            return false
        }
        
        return true

    }

    // ID: NAACCR-01068; TAG: N1075; NAME: RX Date Systemic Flag (NAACCR)
    public boolean naaccr01068(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "10,11,12,15"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-01069; TAG: N1130; NAME: RX Date Systemic, Date Flag (NAACCR)
    public boolean naaccr01069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic)) {
            if (!functions.GEN_INLIST(untrimmedline.rxDateSystemicFlag, "10-12,15"))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Systemic is blank, RX Date Systemic Flag must be 10, 11, 12, or 15')
        }
        else {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSystemicFlag))
                return functions.GEN_ERROR_MSG(binding, 'If RX Date Systemic is present, corresponding date flag must be blank')
        }
        return true

    }

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

    }

    // ID: NAACCR-01071; TAG: N0800; NAME: RX Date Systemic, Systemic RX (COC)
    public boolean naaccr01071(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo) && functions.GEN_EMPTY(untrimmedline.rxSummHormone) && functions.GEN_EMPTY(untrimmedline.rxSummBrm) && functions.GEN_EMPTY(untrimmedline.rxSummTransplntEndocr))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82-87") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82-87") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82-87") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82-87")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "88") || functions.GEN_INLIST(untrimmedline.rxSummHormone, "88") || functions.GEN_INLIST(untrimmedline.rxSummBrm, "88") || functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "88")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82-88") && functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,82-88") && functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82-88") && functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00,82-88")) {
                if (!functions.GEN_EMPTY(untrimmedline.rxDateSystemic))
                    return false
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.rxDateSystemic)) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03") && !functions.GEN_INLIST(untrimmedline.rxSummHormone, "01") && !functions.GEN_INLIST(untrimmedline.rxSummBrm, "01") && !functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "10-40"))
                return false
        }
        return true

    }

    // ID: NAACCR-01072; TAG: N0135; NAME: RX Hosp--BRM (COC)
    public boolean naaccr01072(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxHospBrm, "00,01,82,85-88,99")

    }

    // ID: NAACCR-01073; TAG: N1236; NAME: RX Hosp--BRM (NAACCR)
    public boolean naaccr01073(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospBrm))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospBrm, "00,01,82,85-88,99")

    }

    // ID: NAACCR-01074; TAG: N0185; NAME: RX Hosp--BRM, RX Summ--BRM (COC)
    public boolean naaccr01074(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospBrm) || functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospBrm, "01")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "01"))
                return false
        }
        return true

    }

    // ID: NAACCR-01075; TAG: N0136; NAME: RX Hosp--Chemo (COC)
    public boolean naaccr01075(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxHospChemo, "00,01,02,03,82,85,86,87,88,99")

    }

    // ID: NAACCR-01076; TAG: N1237; NAME: RX Hosp--Chemo (NAACCR)
    public boolean naaccr01076(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospChemo))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospChemo, "00,01,02,03,82,85,86,87,88,99")

    }

    // ID: NAACCR-01077; TAG: N0183; NAME: RX Hosp--Chemo, RX Summ--Chemo (COC)
    public boolean naaccr01077(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospChemo) || functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospChemo, "01,02,03")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "01,02,03"))
                return false
        }
        return true

    }

    // ID: NAACCR-01078; TAG: N0142; NAME: RX Hosp--DX/Stg Proc (COC)
    public boolean naaccr01078(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxHospDxStgProc, "00-07,09", "(\\d\\d)")

    }

    // ID: NAACCR-01079; TAG: N1238; NAME: RX Hosp--DX/Stg Proc (NAACCR)
    public boolean naaccr01079(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospDxStgProc))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospDxStgProc, "00-07,09", "(\\d\\d)")

    }

    // ID: NAACCR-01080; TAG: N0187; NAME: RX Hosp--DX/Stg Proc, RX Summ--DX/Stg Proc (COC)
    public boolean naaccr01080(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospDxStgProc) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospDxStgProc, "01-07")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "01-07"))
                return false
        }
        return true

    }

    // ID: NAACCR-01081; TAG: N0076; NAME: RX Hosp--Hormone (COC)
    public boolean naaccr01081(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxHospHormone, "00,01,82,85,86,87,88,99")

    }

    // ID: NAACCR-01082; TAG: N1239; NAME: RX Hosp--Hormone (NAACCR)
    public boolean naaccr01082(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospHormone))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospHormone, "00,01,82,85,86,87,88,99")

    }

    // ID: NAACCR-01083; TAG: N0184; NAME: RX Hosp--Hormone, RX Summ--Hormone (COC)
    public boolean naaccr01083(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospHormone) || functions.GEN_EMPTY(untrimmedline.rxSummHormone))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospHormone, "01")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "01"))
                return false
        }
        return true

    }

    // ID: NAACCR-01084; TAG: N0139; NAME: RX Hosp--Other (COC)
    public boolean naaccr01084(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospOther))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospOther, "0-3,6-9")

    }

    // ID: NAACCR-01085; TAG: N0721; NAME: RX Hosp--Other, Date of Diagnosis (COC)
    public boolean naaccr01085(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.rxHospOther))
                return false
        }
        return true

    }

    // ID: NAACCR-01086; TAG: N0186; NAME: RX Hosp--Other, RX Summ--Other (COC)
    public boolean naaccr01086(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospOther) || functions.GEN_EMPTY(untrimmedline.rxSummOther))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospOther, "1-6")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "1-6"))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: NAACCR-01089; TAG: N0575; NAME: RX Hosp--Palliative Proc, RX Summ--Pall Proc (COC)
    public boolean naaccr01089(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospPalliativeProc) || functions.GEN_EMPTY(untrimmedline.rxSummPalliativeProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospPalliativeProc, "1-7")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummPalliativeProc, "1-7"))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-01091; TAG: N0257; NAME: RX Hosp--Scope LN Sur, RX Summ--Scope LN Sur(COC)
    public boolean naaccr01091(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_VAL(untrimmedline.rxHospScopeRegLnSur) > 0) {
            if (functions.GEN_VAL(untrimmedline.rxSummScopeRegLnSur) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "1-7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,9"))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-01095; TAG: N0591; NAME: RX Hosp--Scope Reg 98-02, RX Hosp--Scope Reg (COC)
    public boolean naaccr01095(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospScopeReg9802)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "0,9"))
                return true
            else
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-01097; TAG: N1241; NAME: RX Hosp--Scope Reg LN Sur (NAACCR)
    public boolean naaccr01097(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "0-7,9")

    }

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

    }

    // ID: NAACCR-01099; TAG: N0611; NAME: RX Hosp--Scope Reg LN Sur, Primary Site,ICDO3 (COC)
    public boolean naaccr01099(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3) || functions.GEN_EMPTY(untrimmedline.rxHospScopeRegLnSur))
            return true
        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.rxHospScopeRegLnSur, "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,761-768,809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.rxHospScopeRegLnSur, "9"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-01100; TAG: N0983; NAME: RX Hosp--Surg App 2010 (COC)
    public boolean naaccr01100(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgApp2010))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxHospSurgApp2010, "0-5, 9"))
            return false
        
        return true

    }

    // ID: NAACCR-01101; TAG: N0984; NAME: RX Hosp--Surg App 2010, Date of Diagnosis (COC)
    public boolean naaccr01101(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.rxHospSurgApp2010))
                return false
        }
        return true

    }

    // ID: NAACCR-01102; TAG: N1065; NAME: RX Hosp--Surg App 2010, Surg Prim Site (COC)
    public boolean naaccr01102(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        functions.GEN_NOOP()
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgApp2010) || functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite))
            return true
        if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "99") != 0) {
            if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "9") == 0)
                return false
        }
        if (dx_year >= 2010 && dx_year <= 2020) {
        
            if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "0098", 2) != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "0") == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "0") != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "0098", 2) == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "99") != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "9") == 0)
                    return false
            }
        }
        if (dx_year >= 2021) {
            if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "00") != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "0") == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "98") != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "9") == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "0") != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "00") == 0)
                    return false
            }
            if (functions.GEN_AT(untrimmedline.rxHospSurgApp2010, "9") != 0) {
                if (functions.GEN_AT(untrimmedline.rxHospSurgPrimSite, "9899", 2) == 0)
                    return false
            }
        }
        return true

    }

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

    }

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

    }

    // ID: NAACCR-01105; TAG: N0592; NAME: RX Hosp--Surg Oth 98-02, RX Hosp--Surg Oth (COC)
    public boolean naaccr01105(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgOth9802)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgOthRegDis, "0,9"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-01106; TAG: N0258; NAME: RX Hosp--Surg Oth Reg, RX Summ--Surg Oth Reg (COC)
    public boolean naaccr01106(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgOthRegDis) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgOthRegDis, "1-5")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "1-5"))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-01108; TAG: N1242; NAME: RX Hosp--Surg Oth Reg/Dis (NAACCR)
    public boolean naaccr01108(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgOthRegDis))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospSurgOthRegDis, "0-5,9")

    }

    // ID: NAACCR-01109; TAG: N0181; NAME: RX Hosp--Surg Pri Sit, RX Summ--Surg Pri Sit (COC)
    public boolean naaccr01109(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_VAL(untrimmedline.rxHospSurgPrimSite) > 0) {
            if (functions.GEN_VAL(untrimmedline.rxSummSurgPrimSite) == 0)
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "10-90")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,99"))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-01111; TAG: N1243; NAME: RX Hosp--Surg Prim Site (NAACCR)
    public boolean naaccr01111(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite))
            return true
        return functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00, 10-90, 98, 99", "(\\d\\d)")

    }

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

    }

    // ID: NAACCR-01113; TAG: N0603; NAME: RX Hosp--Surg Prim Site, Primary Site, ICDO3 (COC)
    public boolean naaccr01113(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] Gpcode = new char[3], Sitelow = new char[5], Sitehigh = new char[5]
        char[] Sitegrp = new char[5]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgPrimSite)) {
            return true
        }
        if (dx_year < 2010) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9750,9760-9764,9800-9820,9826,9831-9920,9931-9964,9980-9989")) {
                if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "98"))
                    return true
                else
                    return false
            }
        }
        if (dx_year > 2009) {
            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.rxHospSurgPrimSite, "98"))
                    return true
                else
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,760-768, 809", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "98"))
                return true
            else {
                return false
            }
        }
        if (functions.GEN_RLOOKUP(untrimmedline.primarySite, context.NAACCR_SITGRP03, context.NAACCR_SITGRP03_SITELOW, ['GPCODE':Gpcode, 'SITELOW':Sitelow, 'SITEHIGH':Sitehigh])) {
            if (functions.GEN_STRCMP(untrimmedline.primarySite, Sitelow) >= 0 && functions.GEN_STRCMP(untrimmedline.primarySite, Sitehigh) <= 0)
                functions.GEN_STRCPY(Sitegrp, Gpcode)
            else
                functions.GEN_STRCPY(Sitegrp, "30")
        }
        else {
            functions.GEN_STRCPY(Sitegrp, "30")
        }
        if (functions.GEN_INLIST(Sitegrp, "30") && functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "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.rxHospSurgPrimSite)
        
        if (functions.GEN_LOOKUP(Sitegrp, context.NAACCR_SURG03, context.NAACCR_SURG03_GROUPCODE, [:]))
            return true
        return false

    }

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

    }

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

    }

    // ID: NAACCR-01116; TAG: N0593; NAME: RX Hosp--Surg Site 98-02, RX Hosp--Surg Site (COC)
    public boolean naaccr01116(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002)
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxHospSurgSite9802)) {
            if (!functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00,98,99"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgSite9802, "00")) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "10-90,99"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.rxHospSurgSite9802, "10-90,99")) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "00"))
                return false
        }
        return true

    }

    // ID: NAACCR-01117; TAG: N0134; NAME: RX Summ--BRM (COC)
    public boolean naaccr01117(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,82,85-88,99", "(\\d\\d)")

    }

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

    }

    // ID: NAACCR-01119; TAG: N0819; NAME: RX Summ--BRM, Date of DX (NPCR)
    public boolean naaccr01119(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
                return false
        }
        if (dx_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--BRM cannot be blank')
        }
        return true

    }

    // ID: NAACCR-01120; TAG: N0291; NAME: RX Summ--BRM, DateDX, RptSrc (SEER IF63)
    public boolean naaccr01120(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if ((functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis)) && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7")))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (dx_year < 1988) {
            if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,88,99", "(\\d\\d)"))
                return true
            else
                return false
        }
        else {
            if ((dx_year >= 1988) && (dx_year <= 2002)) {
                if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,87,88,99", "(\\d\\d)"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 2002) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,01,82,85-88,99", "(\\d\\d)"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01121; TAG: N1249; NAME: RX Summ--BRM, RX Date BRM (COC)
    public boolean naaccr01121(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateBrm) && functions.GEN_EMPTY(untrimmedline.rxDateBrmFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "00,82,85-87")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm}, RX Date BRM Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "01")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateBrm))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and RX Date BRM is blank, if year of Date of Diagnosis < 2012, RX Date BRM Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and RX Date BRM is blank, if year of Date of Diagnosis > 2011, RX Date BRM Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "88")) {
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10,11,12,15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and Date of Diagnosis < 2012, RX Date BRM Flag must = 10, 11, 12, 15')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm} and Date of Diagnosis > 2011, RX Date BRM Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "99")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateBrmFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--BRM = ${untrimmedline.rxSummBrm}, RX Date BRM Flag must = 10')
        }
        return true

    }

    // ID: NAACCR-01122; TAG: N0392; NAME: RX Summ--BRM, RX Text--BRM (NAACCR)
    public boolean naaccr01122(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "01", "(\\d\\d)")) {
            if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextBrm, 1, 79)))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-01124; TAG: N0137; NAME: RX Summ--Chemo (COC)
    public boolean naaccr01124(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,82,85-88,99", "(\\d\\d)")

    }

    // ID: NAACCR-01125; TAG: N0823; NAME: RX Summ--Chemo (NPCR)
    public boolean naaccr01125(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,82,85-88,99", "(\\d\\d)")

    }

    // ID: NAACCR-01126; TAG: N0817; NAME: RX Summ--Chemo, Date of DX (NPCR)
    public boolean naaccr01126(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2010) {
            return true
        }
        if (dx_year < 2015) {
            if (!(functions.GEN_INLIST(untrimmedline.primarySite, "180-189,199,209,500-509", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-9044,9060-9136,9141-9582")))
                return true
            if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
                return false
        }
        if (dx_year > 2014) {
            if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
                return functions.GEN_ERROR_MSG(binding, 'If DX year = 2015 or later, RX Summ--Chemo cannot be blank')
        }
        return true

    }

    // ID: NAACCR-01127; TAG: N0292; NAME: RX Summ--Chemo, DateDX, RptSrc (SEER IF61)
    public boolean naaccr01127(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2000) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00", "(\\d\\d)"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "99", "(\\d\\d)"))
                return true
            else
                return false
        }
        if ((dx_year < 1988) && !functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,01,88,99", "(\\d\\d)"))
                return true
            else
                return false
        }
        else {
            if (((dx_year >= 1988) && (dx_year <= 2002)) || ((dx_year < 2003) && functions.GEN_INLIST(untrimmedline.registryId, "0000001529", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))) {
                if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,87,88,99", "(\\d\\d)"))
                    return true
                else
                    return false
            }
            else {
                if (dx_year > 2002) {
                    if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00-03,82,85-88,99", "(\\d\\d)"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-01128; TAG: N1038; NAME: RX Summ--Chemo, RX Date Chemo (COC)
    public boolean naaccr01128(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummChemo))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateChemo) && functions.GEN_EMPTY(untrimmedline.rxDateChemoFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "00,82,85-87")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo}, RX Date Chemo Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "01-03")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateChemo))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and RX Date Chemo is blank, if year of Date of Diagnosis < 2012, RX Date Chemo Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and RX Date Chemo is blank, if year of Date of Diagnosis > 2011, RX Date Chemo Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "88")) {
            if (dx_year < 2012) {
                if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10,11,12,15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and Date of Diagnosis < 2012, RX Date Chemo Flag must = 10, 11, 12, 15')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "15"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo} and Date of Diagnosis > 2011, RX Date Chemo Flag must = 15')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "99")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateChemoFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Chemo = ${untrimmedline.rxSummChemo}, RX Date Chemo Flag must = 10')
        }
        return true

    }

    // ID: NAACCR-01129; TAG: N0393; NAME: RX Summ--Chemo, RX Text--Chemo (NAACCR)
    public boolean naaccr01129(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.rxSummChemo, "01,02,03", "(\\d\\d)")) {
            if (functions.GEN_EMPTY(functions.GEN_SUBSTR(untrimmedline.rxTextChemo, 1, 79)))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-01131; TAG: N0125; NAME: RX Summ--DX/Stg Proc (COC)
    public boolean naaccr01131(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00-07,09", "(\\d\\d)")

    }

    // ID: NAACCR-01132; TAG: N1244; NAME: RX Summ--DX/Stg Proc (NAACCR)
    public boolean naaccr01132(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        return functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00-07,09", "(\\d\\d)")

    }

    // ID: NAACCR-01133; TAG: N0194; NAME: RX Summ--DX/Stg Proc, RX Date DX/Stg Proc (COC)
    public boolean naaccr01133(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc) && functions.GEN_EMPTY(untrimmedline.rxDateDxStgProcFlag))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "11"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc}, RX Date Dx/Stg Proc Flag must = 11')
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "01-07")) {
            if (!functions.GEN_EMPTY(untrimmedline.rxDateDxStgProc))
                return true
            else {
                if (dx_year < 2012) {
                    if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "10, 12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc} and RX Date DX/Stg Proc is blank, if year of Date of Diagnosis < 2012, RX Date Dx/Stg Proc Flag must = 10 or 12')
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "12"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc} and RX Date DX/Stg Proc is blank, if year of Date of Diagnosis > 2011, RX Date Dx/Stg Proc Flag must = 12')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "09")) {
            if (functions.GEN_INLIST(untrimmedline.rxDateDxStgProcFlag, "10"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--DX/Stg Proc = ${untrimmedline.rxSummDxStgProc}, RX Date Dx/Stg Proc Flag must = 10')
        }
        return true

    }

    // ID: NAACCR-01134; TAG: N0138; NAME: RX Summ--Hormone (COC)
    public boolean naaccr01134(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.rxSummHormone, "00,01,82,85-88,99", "(\\d\\d)")

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy