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

com.imsweb.validation.edits.translated.naaccr.NaaccrTranslatedCompiledRules2.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 NaaccrTranslatedCompiledRules2 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-00293' <= id && id <= 'NAACCR-00564'
    }

    // ID: NAACCR-00293; TAG: N1720; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellVulva (CS)
    public boolean naaccr00293(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellVulva"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010,105-109,114-130,600")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,005,100")) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Site-Specific Factor 3')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8")) {
        
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "150")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "105-109,114-130,600")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0, 1, 5, 9")) {
        
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00294; TAG: N1768; NAME: CS LN, RNP, Nodes Eval, SSF 3, MelanomaSkin (CS)
    public boolean naaccr00294(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaSkin"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,125,155")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage')
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8")) {
                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,97,98")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010-100")) {
                            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-95,99")) {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,050,100")) {
                                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,125,158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98")) {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                    }
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "125,155") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                                            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                        }
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,122-123,125,152-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97,99")) {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                            }
                                        }
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "124") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01,95,97,99")) {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                                }
                                            }
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "124") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "02-90")) {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,050,100")) {
                                                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,121-128,152-153") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010,100")) {
                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                    }
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "155-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,010")) {
                            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                        }
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010,100-118,121-128,152-153,155-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97")) {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                            }
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "010,100-118,121-128,152-153") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "99")) {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005,100")) {
                                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                }
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "155-158") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "99")) {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "005")) {
                                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                                        functions.GEN_SAVE_ERROR_TEXT(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Lymph Nodes, CS Lymph Nodes Eval, CS Site-Specific Factor 3, Regional Nodes Positive')
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00297; TAG: N1025; NAME: CS Lymph Nodes Eval, Lymph Nodes, Breast Schema (CS)
    public boolean naaccr00297(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "255,257,510,610,735,810")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,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 false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "050,130,150,155,250,258,520,620,710,720,730,815")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,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 false
            }
        }
        return true

    }

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

    }

    // ID: NAACCR-00300; TAG: N1346; NAME: CS Lymph Nodes, IntracranialGland Schema (CS)
    public boolean naaccr00300(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int err_flag
        err_flag = 0
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "IntracranialGland"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "988,999"))
            return false
        return true

    }

    // ID: NAACCR-00301; TAG: N1721; NAME: CS Lymph Nodes, LN Nodes Eval, RNP, Testis (CS)
    public boolean naaccr00301(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-500")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8")) {
                if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98,99"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00302; TAG: N1803; NAME: CS Lymph Nodes, Lymph Nodes Eval, RNP (CS)
    public boolean naaccr00302(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined))
            functions.GEN_NOOP()
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "LymphomaOcularAdnexa,MelanomaSkin,MerkelCellPenis,MerkelCellScrotum"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin,MerkelCellVulva,Retinoblastoma"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Breast") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "050"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "EsophagusGEJunction") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "100"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Stomach") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "100,110"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "050"))
            return true
        if (functions.GEN_INLIST(t_schema_name, "NETStomach,NETColon,NETRectum,GISTAppendix,GISTStomach,GISTColon,GISTRectum") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "050,100"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999") && functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "3,6")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00303; TAG: N1380; NAME: CS Lymph Nodes, MyelomaPlasmaCellDisorder (CS)
    public boolean naaccr00303(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,100,999")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "987")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731,9732")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00304; TAG: N1060; NAME: CS Lymph Nodes, Nodes Pos, ColoAppRectal (CS)
    public boolean naaccr00304(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon, Appendix, Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-90")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "400,410,420,430,450,460,470,480")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "400,410,420,430,450,460,470,480")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "95,97")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00305; TAG: N2361; NAME: CS Lymph Nodes, Nodes Pos, MelanomaSkin (CS)
    public boolean naaccr00305(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaSkin"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "122,123,124,152,153,158")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98"))
                return functions.GEN_ERROR_MSG(binding, 'MelanomaSkin schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then Regional Nodes Positive must not = ${untrimmedline.regionalNodesPositive}')
        }
        return true

    }

    // ID: NAACCR-00306; TAG: N1580; NAME: CS Lymph Nodes, Nodes Pos, MerkelCell Schemas (CS)
    public boolean naaccr00306(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "320,340,350")) {
                if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        else {
            if (functions.GEN_INLIST(t_schema_name, "MerkelCellPenis")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "120,140,150")) {
                    if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                        return false
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(t_schema_name, "MerkelCellVulva")) {
                    if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "115,120,125")) {
                        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                            return false
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00307; TAG: N0899; NAME: CS Lymph Nodes, Nodes Pos, SSF 3, Breast Schema (CS)
    public boolean naaccr00307(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "050")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "710,730,735,740,745,764,770 ")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "001-097")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "001-097")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,710,730,735,740,745,764,770 ")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000-089") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00-89")) {
        
                if (functions.GEN_VAL(untrimmedline.regionalNodesPositive) < functions.GEN_VAL(untrimmedline.csSiteSpecificFactor3)) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'Breast schema: CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}) must be less than or = Regional Nodes Positive (${untrimmedline.regionalNodesPositive})')
                }
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00308; TAG: N0784; NAME: CS Lymph Nodes, Regional Nodes Positive (CS)
    public boolean naaccr00308(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[100], SSF4_SEER = 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
        
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00309; TAG: N0703; NAME: CS Lymph Nodes, SSF 1, Head/Neck Schemas (CS)
    public boolean naaccr00309(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00310; TAG: N1723; NAME: CS Lymph Nodes, SSF 17, Penis (CS)
    public boolean naaccr00310(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Penis"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000"))
                    return functions.GEN_ERROR_MSG(binding, 'Penis schema: If CS Lymph Nodes = 000, CS Site-Specific Factor17 must = 000')
            }
        }
        return true

    }

    // ID: NAACCR-00311; TAG: N0704; NAME: CS Lymph Nodes, SSF 4, 5, Breast Schema (CS)
    public boolean naaccr00311(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int err_flag
        err_flag = 0
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "987")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict among schema, CS Lymph Nodes, and CS Site-Specific Factor 4')
                err_flag = 1
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "987")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict among schema, CS Lymph Nodes, and CS Site-Specific Factor 5')
                err_flag = 1
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "987,988") && (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4))) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict among schema, CS Lymph Nodes, and CS Site-Specific Factor 4')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "987,988") && (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5))) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict among schema, CS Lymph Nodes, and CS Site-Specific Factor 5')
                err_flag = 1
            }
        }
        if (err_flag == 1) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        return true

    }

    // ID: NAACCR-00312; TAG: N0964; NAME: CS Lymph Nodes, SSF 3, Nodes Eval, MelanomaSkin (CS)
    public boolean naaccr00312(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8720-8790"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaSkin"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,005")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "121,128")) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes must not = ${untrimmedline.csLymphNodes}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "121,128")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "122,123,124,152,153,158")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8,9")) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020,043,045,048,050,100,150")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "8")) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
            }
        }
        return true

    }

    // ID: NAACCR-00313; TAG: N1371; NAME: CS Lymph Nodes, SSF 3, Nodes Eval, MerkelCell (CS)
    public boolean naaccr00313(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,005")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,390,400")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes must not = ${untrimmedline.csLymphNodes}')
                }
                else
                    return true
            }
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "310")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "320,340,350")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "8")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellPenis")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,005")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,410,420")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes must not = ${untrimmedline.csLymphNodes}')
                }
                else
                    return true
            }
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "110")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "120,140,150")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "8")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellVulva")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,005")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,510,520")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes must not = ${untrimmedline.csLymphNodes}')
                }
                else
                    return true
            }
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "114")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "150,120,125")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "2,3,6,8,9")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "8")) {
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'For this schema: If CS Site-Specific Factor 3 = ${untrimmedline.csSiteSpecificFactor3}, then CS Lymph Nodes Eval must not = ${untrimmedline.csLymphNodesEval}')
                }
            }
        }
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00316; TAG: N0945; NAME: CS Mets Eval, Mets at DX, CS Version Inp Orig (CS)
    public boolean naaccr00316(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int w_cs_version_1st
        w_cs_version_1st = functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.csVersionInputOriginal, 1, 4))
        if (w_cs_version_1st < 104)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csMetsEval) || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsEval, "2,3,6")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                return false
        }
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00319; TAG: N1171; NAME: CS Mets at DX, Colon Schema (CS)
    public boolean naaccr00319(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int tot_mets
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "1") || functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "1") || functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "1") || functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "1")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,08,16,18,31,33")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        tot_mets = 0
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "1"))
            tot_mets = tot_mets + 1
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "1"))
            tot_mets = tot_mets + 1
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "1"))
            tot_mets = tot_mets + 1
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "1"))
            tot_mets = tot_mets + 1
        if (tot_mets > 1) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "26,27")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00320; TAG: N0962; NAME: CS Mets at DX, Lung, Laterality (CS)
    public boolean naaccr00320(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Lung"))
            return true
        if (functions.GEN_INLIST(untrimmedline.laterality, "4")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDx, "23,25,26,36,38,40,41,42,43,50,51,52,53,70,75"))
                return false
        }
        return true

    }

    // ID: NAACCR-00321; TAG: N1172; NAME: CS Mets at DX, Rectum Schema (CS)
    public boolean naaccr00321(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int tot_mets
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "1") || functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "1") || functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "1") || functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "1")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,08,16,18,29,31,33")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00322; TAG: N1174; NAME: CS Mets at DX, SSF 20, Breast Schema (CS)
    public boolean naaccr00322(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor20, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,05,07")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor20, "000,005"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "10,40,42,44,50,60")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor20, "000,005"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "99")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor20, "999"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00323; TAG: N1714; NAME: CS Mets at DX, SSF 4, MelanomaChor/Cil/Iris (CS)
    public boolean naaccr00323(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) || (dx_year < 2010))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "10,40,50,52,54,56,60")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

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

    }

    // ID: NAACCR-00325; TAG: N1893; NAME: CS Mets at DX-BBLL, LymphomaOcularAdnexa (CS)
    public boolean naaccr00325(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        int req_flag
        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_INLIST(untrimmedline.registryId, "0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "LymphomaOcularAdnexa"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Bone must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Brain must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Liver must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Lung must not = 8')
        return true

    }

    // ID: NAACCR-00326; TAG: N1894; NAME: CS Mets at DX-BBLL, MycosisFungoides (CS)
    public boolean naaccr00326(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8") && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MycosisFungoides"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Bone must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Brain must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Liver must not = 8')
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'MycosisFungoides schema: CS Mets at Dx-Lung must not = 8')
        return true

    }

    // ID: NAACCR-00327; TAG: N0987; NAME: CS Mets at DX-Bone (CS)
    public boolean naaccr00327(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "0,1,8,9"))
            return false
        
        return true

    }

    // ID: NAACCR-00328; TAG: N1944; NAME: CS Mets at DX-Bone, CS Mets at DX (CS)
    public boolean naaccr00328(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone) || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "1")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at Dx-Bone = ${untrimmedline.csMetsAtDxBone}, CS Mets at DX must not = 00 or 99')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "0"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx}, CS Mets at Dx-Bone must = 0')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98") && !functions.GEN_INLIST(t_schema_name, "IllDefinedOther")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx} and schema is not IllDefinedOther, CS Mets at Dx-Bone must = 8')
        }
        
        return true

    }

    // ID: NAACCR-00329; TAG: N0988; NAME: CS Mets at DX-Brain (CS)
    public boolean naaccr00329(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "0,1,8,9"))
            return false
        
        return true

    }

    // ID: NAACCR-00330; TAG: N1945; NAME: CS Mets at DX-Brain, CS Mets at DX (CS)
    public boolean naaccr00330(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain) || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "1")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at Dx-Brain = ${untrimmedline.csMetsAtDxBrain}, CS Mets at DX must not = 00 or 99')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "0"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx}, CS Mets at Dx-Brain must = 0')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98") && !functions.GEN_INLIST(t_schema_name, "IllDefinedOther")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx} and schema is not IllDefinedOther, CS Mets at Dx-Brain must = 8')
        }
        
        return true

    }

    // ID: NAACCR-00331; TAG: N0989; NAME: CS Mets at DX-Liver (CS)
    public boolean naaccr00331(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "0,1,8,9"))
            return false
        
        return true

    }

    // ID: NAACCR-00332; TAG: N1947; NAME: CS Mets at DX-Liver, CS Mets at DX (CS)
    public boolean naaccr00332(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver) || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "1")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at Dx-Liver = ${untrimmedline.csMetsAtDxLiver}, CS Mets at DX must not = 00 or 99')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "0"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx}, CS Mets at Dx-Liver must = 0')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98") && !functions.GEN_INLIST(t_schema_name, "IllDefinedOther")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx} and schema is not IllDefinedOther, CS Mets at Dx-Liver must = 8')
        }
        
        return true

    }

    // ID: NAACCR-00333; TAG: N0990; NAME: CS Mets at DX-Lung (CS)
    public boolean naaccr00333(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "0,1,8,9"))
            return false
        
        return true

    }

    // ID: NAACCR-00334; TAG: N1948; NAME: CS Mets at DX-Lung, CS Mets at DX (CS)
    public boolean naaccr00334(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung) || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "1")) {
            if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at Dx-Lung = ${untrimmedline.csMetsAtDxLung}, CS Mets at DX must not = 00 or 99')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "0"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx}, CS Mets at Dx-Lung must = 0')
        }
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98") && !functions.GEN_INLIST(t_schema_name, "IllDefinedOther")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Mets at DX = ${untrimmedline.csMetsAtDx} and schema is not IllDefinedOther, CS Mets at Dx-Lung must = 8')
        }
        
        return true

    }

    // ID: NAACCR-00335; TAG: N2116; NAME: CS Over-ride CS 20, Date of Diagnosis (NPCR)
    public boolean naaccr00335(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        }
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year < 2004)) {
            if (!functions.GEN_EMPTY(untrimmedline.overRideCs20))
                return functions.GEN_ERROR_MSG(binding, 'If DX Year less than 2004 or blank, Over-ride CS 20 must be blank')
        }
        else {
            if (dx_year < 2012) {
                if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")) {
                    if (!functions.GEN_EMPTY(untrimmedline.overRideCs20))
                        return false
                }
            }
            else {
                if (dx_year > 2015) {
                    if (!functions.GEN_EMPTY(untrimmedline.overRideCs20))
                        return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis is 2016 or later, Over-ride CS 20 must be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00336; TAG: N1705; NAME: CS Over-ride CS 20, Rpt Srce, CS Fields (NPCR)
    public boolean naaccr00336(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csExtension) || !functions.GEN_EMPTY(untrimmedline.csTumorSize) || !functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || !functions.GEN_EMPTY(untrimmedline.csLymphNodes) || !functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || !functions.GEN_EMPTY(untrimmedline.csMetsAtDx) || !functions.GEN_EMPTY(untrimmedline.csMetsEval) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23) || !functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24)) {
        
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Site-Specific Factor25 cannot be left blank')
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Version Input Original cannot be left blank')
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Version Input Current cannot be left blank')
        }
        
        return true

    }

    // ID: NAACCR-00337; TAG: N1595; NAME: CS Over-rides (NPCR)
    public boolean naaccr00337(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_EMPTY(untrimmedline.overRideCs1) || !functions.GEN_EMPTY(untrimmedline.overRideCs2) || !functions.GEN_EMPTY(untrimmedline.overRideCs3) || !functions.GEN_EMPTY(untrimmedline.overRideCs4) || !functions.GEN_EMPTY(untrimmedline.overRideCs5) || !functions.GEN_EMPTY(untrimmedline.overRideCs6) || !functions.GEN_EMPTY(untrimmedline.overRideCs7) || !functions.GEN_EMPTY(untrimmedline.overRideCs8) || !functions.GEN_EMPTY(untrimmedline.overRideCs9) || !functions.GEN_EMPTY(untrimmedline.overRideCs10) || !functions.GEN_EMPTY(untrimmedline.overRideCs11) || !functions.GEN_EMPTY(untrimmedline.overRideCs12) || !functions.GEN_EMPTY(untrimmedline.overRideCs13) || !functions.GEN_EMPTY(untrimmedline.overRideCs14) || !functions.GEN_EMPTY(untrimmedline.overRideCs15) || !functions.GEN_EMPTY(untrimmedline.overRideCs16) || !functions.GEN_EMPTY(untrimmedline.overRideCs17) || !functions.GEN_EMPTY(untrimmedline.overRideCs18) || !functions.GEN_EMPTY(untrimmedline.overRideCs19))
            return functions.GEN_SAVE_ERROR_TEXT(binding, 'CS Over-ride fields 1-19 must be blank')
        if (functions.GEN_EMPTY(untrimmedline.overRideCs20) || functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))
            return true
        else
            return functions.GEN_SAVE_ERROR_TEXT(binding, 'Over-ride CS 20 must be blank or = 1')
        
        return true

    }

    // ID: NAACCR-00338; TAG: N1321; NAME: CS Reg Nodes Ex, Pos, Site, Hist ICDO3, Report (CS)
    public boolean naaccr00338(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        int rnp, rne, err_flag
        int dx_year
        
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2004 || dx_year > 2017)
            return true
        if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        rnp = functions.GEN_VAL(untrimmedline.regionalNodesPositive)
        rne = functions.GEN_VAL(untrimmedline.regionalNodesExamined)
        
        if (functions.GEN_VAL(untrimmedline.typeOfReportingSource) == 7) {
            if ((rne != 99) || (rnp != 99))
                return functions.GEN_ERROR_MSG(binding, 'Death Certificate Only, Regional Nodes Positive and Examined must both = 99')
            else
                return true
        }
        if (functions.GEN_INLIST(t_schema_name, "HemeRetic,Lymphoma,Brain,CNSOther,IllDefinedOther,Placenta") || functions.GEN_INLIST(t_schema_name, "IntracranialGland") || (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder") && !functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9734"))) {
            if ((rnp != 99) || (rne != 99)) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Regional Nodes Positive and Examined must both = 99 for this Schema, site/histology')
            }
        }
        if ((dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510)) {
            if (rne == 0 && rnp != 98)
                err_flag = 1
            else {
                if (rne >= 1 && rne <= 90) {
                    if (rnp == 97 || rnp == 99 || rnp <= rne)
                        return true
                    else
                        err_flag = 1
                }
                else {
                    if (rne == 95 || rne == 96 || rne == 97 || rne == 98) {
                        if ((rnp >= 0 && rnp <= 90) || (rnp == 95) || (rnp == 97) || (rnp == 99))
                            return true
                        else
                            err_flag = 1
                    }
                    else {
                        if (rne == 99) {
                            if (rnp == 99)
                                return true
                            else
                                err_flag = 1
                        }
                    }
                }
            }
        }
        else {
            if (rne == 0 && rnp != 98)
                err_flag = 1
            else {
                if (rne >= 1 && rne <= 90) {
                    if (rnp == 95 || rnp == 97 || rnp == 99 || rnp <= rne)
                        return true
                    else
                        err_flag = 1
                }
                else {
                    if (rne == 95) {
                        if (rnp == 0 || rnp == 95 || rnp == 99)
                            return true
                        else
                            err_flag = 1
                    }
                }
            }
            if (rne == 96 || rne == 97 || rne == 98) {
                if ((rnp >= 0 && rnp <= 90) || (rnp == 95) || (rnp == 97) || (rnp == 99))
                    return true
                else
                    err_flag = 1
            }
            else {
                if (rne == 99) {
                    if (rnp == 99)
                        return true
                    else
                        err_flag = 1
                }
            }
        }
        if (err_flag == 1) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        return true

    }

    // ID: NAACCR-00339; TAG: N1895; NAME: CS SSF 1, Behavior, Lung Schema (CS)
    public boolean naaccr00339(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Lung"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00340; TAG: N1908; NAME: CS SSF 1, Brain, CNSOther, IntracranialGland (CS)
    public boolean naaccr00340(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00341; TAG: N1538; NAME: CS SSF 1, CS SSF 3, Lower GI Schemas (CS)
    public boolean naaccr00341(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "SmallIntestine,Appendix,Colon,Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00342; TAG: N1539; NAME: CS SSF 1, Extension, Gyn Schemas (CS)
    public boolean naaccr00342(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Cervix,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") && !functions.GEN_INLIST(t_schema_name, "FallopianTube,Vagina,Vulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "987")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00343; TAG: N1764; NAME: CS SSF 1, Extension, KidneyParenchyma Schema (CS)
    public boolean naaccr00343(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010,020,030,991")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "000,100"))
                return false
        }
        return true

    }

    // ID: NAACCR-00344; TAG: N1746; NAME: CS SSF 1, Histol, Urothelial Schemas (CS)
    public boolean naaccr00344(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis,Bladder,Urethra"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "987")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8020, 8031, 8050, 8082, 8120-8124, 8130-8131")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00345; TAG: N1896; NAME: CS SSF 1, Lymph Nodes, CorpusAdenosarcoma (CS)
    public boolean naaccr00345(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100,120,130,140,200,210,220,310,320"))
                return false
        }
        return true

    }

    // ID: NAACCR-00346; TAG: N1897; NAME: CS SSF 1, Lymph Nodes, CorpusCarcinoma (CS)
    public boolean naaccr00346(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "CorpusCarcinoma"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100,110,120,200,310,320"))
                return false
        }
        return true

    }

    // ID: NAACCR-00347; TAG: N1898; NAME: CS SSF 1, Lymph Nodes, CorpusSarcoma (CS)
    public boolean naaccr00347(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "CorpusSarcoma"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100,110,120,200,210,220,310,320"))
                return false
        }
        return true

    }

    // ID: NAACCR-00348; TAG: N0705; NAME: CS SSF 1, RX Summ--Surg, Retinoblastoma Schema (CS)
    public boolean naaccr00348(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Retinoblastoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "40,41")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "970")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00349; TAG: N0948; NAME: CS SSF 1, SSF 2, Prostate Schema (CS)
    public boolean naaccr00349(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00350; TAG: N1765; NAME: CS SSF 1, SSF 2, SSF 15, SSF 16, Breast (CS)
    public boolean naaccr00350(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2010)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "111"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 111')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "110"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 110')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "101"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 101')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "100"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 100')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "011"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 011')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "010"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 010')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "001"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 001')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "020")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 000')
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "030,996,997,998,999") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030,996,997,998,999") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "030,997,998,999")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "999"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 1 = ${untrimmedline.csSiteSpecificFactor1}, CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, and CS Site-Specific Factor15 = ${untrimmedline.csSiteSpecificFactor15}, CS Site-Specific Factor16 must = 999')
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00351; TAG: N1540; NAME: CS SSF 1, Skin/Scrotum/Merkel Cell Schemas (CS)
    public boolean naaccr00351(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csTumorSize) || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "Skin,Scrotum,MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva")) {
        
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "000") || !functions.GEN_INLIST(untrimmedline.csExtension, "950")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-00352; TAG: N1541; NAME: CS SSF 1, Surg, DX/Stg, Sarcomas (CS)
    public boolean naaccr00352(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "HeartMediastinum,Soft Tissue,Retroperitoneum,Peritoneum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02,05,06", "(\\d\\d)")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00353; TAG: N1542; NAME: CS SSF 1, Surg, DX/Stg, Skin/Scrotum/Merkel (CS)
    public boolean naaccr00353(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Skin,Scrotum,MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02,05,06", "(\\d\\d)")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00354; TAG: N1543; NAME: CS SSF 1, Surg, Sarcomas (CS)
    public boolean naaccr00354(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "HeartMediastinum,Soft Tissue,Retroperitoneum,Peritoneum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00355; TAG: N1544; NAME: CS SSF 1, Surg, Skin/Scrotum/Merkel (CS)
    public boolean naaccr00355(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Skin,Scrotum,MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00356; TAG: N1747; NAME: CS SSF 1, Surg, Urothelial Schemas (CS)
    public boolean naaccr00356(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis,Bladder,Urethra"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        else
            return true
        return true

    }

    // ID: NAACCR-00357; TAG: N1791; NAME: CS SSF 1, Surgery, KidneyParenchyma Schema (CS)
    public boolean naaccr00357(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27"))
                return false
        }
        return true

    }

    // ID: NAACCR-00358; TAG: N1909; NAME: CS SSF 1, TS/Ext Eval, Retinoblastoma Schema (CS)
    public boolean naaccr00358(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Retinoblastoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3,5,6")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "970"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Tumor Size/Ext Eval = ${untrimmedline.csTumorSizeExtEval}, CS Site-Specific Factor 1 must not = 970')
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "6")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "950"))
                return functions.GEN_ERROR_MSG(binding, 'If CS Tumor Size/Ext Eval = ${untrimmedline.csTumorSizeExtEval}, CS Site-Specific Factor 1 must not 950')
        }
        return true

    }

    // ID: NAACCR-00359; TAG: N1545; NAME: CS SSF 1, Upper GI Schemas (CS)
    public boolean naaccr00359(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Esophagus,EsophagusGEJunction,Stomach,NETStomach"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
                else
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "100-400")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
                else
                    return true
            }
        }
        return true

    }

    // ID: NAACCR-00360; TAG: N0951; NAME: CS SSF 1-9, Head and Neck Schemas (CS)
    public boolean naaccr00360(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "987,988,   ")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "987")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "999") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "987,988,999,   ") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "999") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "999") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "999") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "999") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988,999,   ") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988,999,   ") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988,998,999,   ")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00361; TAG: N1899; NAME: CS SSF 10, Lymph Nodes, Vulva Schema (CS)
    public boolean naaccr00361(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vulva"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "100,110,120,200"))
                return false
        }
        return true

    }

    // ID: NAACCR-00362; TAG: N1546; NAME: CS SSF 10, SSF 11, Breast (CS)
    public boolean naaccr00362(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor10 = 998, CS Site-Specific Factor11 (${untrimmedline.csSiteSpecificFactor11}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor11 = 998, CS Site-Specific Factor10 (${untrimmedline.csSiteSpecificFactor10}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "991")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "010")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, CS Site-Specific Factor11 must not = ${untrimmedline.csSiteSpecificFactor11}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "501-980")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "020")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, CS Site-Specific Factor11 must not = ${untrimmedline.csSiteSpecificFactor11}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "020")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "501-990,998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor11 = ${untrimmedline.csSiteSpecificFactor11}, CS Site-Specific Factor10 must not = ${untrimmedline.csSiteSpecificFactor10}')
            }
        }
        return true

    }

    // ID: NAACCR-00363; TAG: N1547; NAME: CS SSF 10, SSF 11, Surgery, DX/Stg, Breast (CS)
    public boolean naaccr00363(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
        
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "998") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If no surgery/BX performed, both CS Site-Specific Factor10 (${untrimmedline.csSiteSpecificFactor10}) and CS Site-Specific Factor11 (${untrimmedline.csSiteSpecificFactor11}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00364; TAG: N1582; NAME: CS SSF 10, SSF 16, Testis (CS)
    public boolean naaccr00364(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "995,996")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor10 = ${untrimmedline.csSiteSpecificFactor10}, CS Site-Specific Factor16 must not = ${untrimmedline.csSiteSpecificFactor16}')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00365; TAG: N1910; NAME: CS SSF 11, GISTAppendix, Colon, Rectum (CS)
    public boolean naaccr00365(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "GISTAppendix,GISTColon,GISTRectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00366; TAG: N1548; NAME: CS SSF 11, Lip/OralCavity/Nasal Schemas (CS)
    public boolean naaccr00366(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988") || functions.GEN_EMPTY(untrimmedline.csTumorSize) || functions.GEN_EMPTY(untrimmedline.csExtension) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "BuccalMucosa,FloorMouth,GumLower,GumOther,GumUpper ") || functions.GEN_INLIST(t_schema_name, "LipLower,LipOther,LipUpper,MouthOther") || functions.GEN_INLIST(t_schema_name, "NasalCavity,PalateHard,SinusEthmoid,SinusMaxillary") || functions.GEN_INLIST(t_schema_name, "MelanomaBuccalMucosa,MelanomaFloorMouth,MelanomaGumLower") || functions.GEN_INLIST(t_schema_name, "MelanomaGumOther,MelanomaGumUpper") || functions.GEN_INLIST(t_schema_name, "MelanomaLipLower,MelanomaLipOther,MelanomaLipUpper") || functions.GEN_INLIST(t_schema_name, "MelanomaMouthOther,MelanomaNasalCavity,MelanomaPalateHard") || functions.GEN_INLIST(t_schema_name, "MelanomaSinusEthmoid,MelanomaSinusMaxillary")) {
        
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "000") || !functions.GEN_INLIST(untrimmedline.csExtension, "950")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
                if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-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 false
                }
            }
        }
        return true

    }

    // ID: NAACCR-00367; TAG: N1780; NAME: CS SSF 11, Lymph Nodes, Vulva (CS)
    public boolean naaccr00367(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,2"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000,998,999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "110-800"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "010,020,030")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00368; TAG: N1420; NAME: CS SSF 11, Surg, Appendix Schema (CS)
    public boolean naaccr00368(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Appendix"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-90")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00369; TAG: N1366; NAME: CS SSF 11, Surg, DX/Stg Proc, Appendix Schema (CS)
    public boolean naaccr00369(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Appendix"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-90") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02,05,06", "(\\d\\d)")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00370; TAG: N1550; NAME: CS SSF 11, Surg, DX/Stg Proc, Skin Schema (CS)
    public boolean naaccr00370(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Skin"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-90") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02,05,06", "(\\d\\d)")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00371; TAG: N1549; NAME: CS SSF 11, Surg, Skin Schema (CS)
    public boolean naaccr00371(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Skin"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-90")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00372; TAG: N1551; NAME: CS SSF 12, SSF 13, Breast (CS)
    public boolean naaccr00372(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor12 = 998, CS Site-Specific Factor13 (${untrimmedline.csSiteSpecificFactor13}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor13 = 998, CS Site-Specific Factor12 (${untrimmedline.csSiteSpecificFactor12}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00373; TAG: N1757; NAME: CS SSF 12, SSF 13, Prostate Schema (CS)
    public boolean naaccr00373(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "001-101")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "991") && (functions.GEN_VAL(untrimmedline.csSiteSpecificFactor12) > functions.GEN_VAL(untrimmedline.csSiteSpecificFactor13)) && (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "999")))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "991")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "000-101,991,999"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998"))
                return false
            else
                return true
        }
        
        return true

    }

    // ID: NAACCR-00374; TAG: N1552; NAME: CS SSF 12, SSF 13, Surgery, DX/Stg, Breast (CS)
    public boolean naaccr00374(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
        
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If no surgery/BX performed, both CS Site-Specific Factor12 (${untrimmedline.csSiteSpecificFactor12}) and CS Site-Specific Factor13 (${untrimmedline.csSiteSpecificFactor13}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00375; TAG: N1583; NAME: CS SSF 12, SSF 13, Testis (CS)
    public boolean naaccr00375(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor12 = 998, CS Site-Specific Factor13 (${untrimmedline.csSiteSpecificFactor13}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor13 = 998, CS Site-Specific Factor12 (${untrimmedline.csSiteSpecificFactor12}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00376; TAG: N1777; NAME: CS SSF 13, Extension, Prostate Schema (CS)
    public boolean naaccr00376(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988") || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "150"))
                return false
        }
        return true

    }

    // ID: NAACCR-00377; TAG: N1584; NAME: CS SSF 14, SSF 15, Testis (CS)
    public boolean naaccr00377(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor14 = 998, CS Site-Specific Factor15 (${untrimmedline.csSiteSpecificFactor15}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor15 = 998, CS Site-Specific Factor14 (${untrimmedline.csSiteSpecificFactor14}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00378; TAG: N1553; NAME: CS SSF 14, Surgery, DX/Stg, Breast (CS)
    public boolean naaccr00378(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
        
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If no surgery/BX performed, CS Site-Specific Factor14 (${untrimmedline.csSiteSpecificFactor14}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00379; TAG: N1554; NAME: CS SSF 15, SSF 9, 11, 13, 14, Breast (CS)
    public boolean naaccr00379(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if ((functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988")) && (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988")) && (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988")) && (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988")) && (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988")))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988,998,999,   ") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988,998,999,   ") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988,998,999,   ") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988,998,999,   ")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If any of SSF 9, 11, 13, or 14 not = 988, 998 or 999, CS Site-Specific Factor15 cannot = 998 or 999')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00380; TAG: N1632; NAME: CS SSF 16, MerkelCell Schemas (CS)
    public boolean naaccr00380(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000")) {
            if (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,390,400,480,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
            if (functions.GEN_INLIST(t_schema_name, "MerkelCellPenis") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,410,420,550,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
            if (functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,400,450,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
            if (functions.GEN_INLIST(t_schema_name, "MerkelCellVulva") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,510,520,700,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), Regional Nodes Positive (${untrimmedline.regionalNodesPositive})')
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,8")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "998,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), RX Summ--Scope Reg LN Sur (${untrimmedline.rxSummScopeRegLnSur})')
                }
                if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, RX Summ--Scope Reg LN Sur (${untrimmedline.rxSummScopeRegLnSur}), Regional Nodes Positive (${untrimmedline.regionalNodesPositive})')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00381; TAG: N1368; NAME: CS SSF 16, Skin and Scrotum Schemas (CS)
    public boolean naaccr00381(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Skin,Scrotum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), Regional Nodes Positive (${untrimmedline.regionalNodesPositive})')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000,988")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "999")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00382; TAG: N1633; NAME: CS SSF 17, MerkelCell Schemas (CS)
    public boolean naaccr00382(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int msg_3325_flag
        
        msg_3325_flag = 0
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988") || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000")) {
            if ((functions.GEN_INLIST(t_schema_name, "MerkelCellPenis") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,420,999")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,400,999")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellVulva") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,520,999")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,400,480,999"))) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor17 (${untrimmedline.csSiteSpecificFactor17}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor17 (${untrimmedline.csSiteSpecificFactor17}), Regional Nodes Positive (${untrimmedline.regionalNodesPositive})')
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "010,040,070")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,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)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor17 (${untrimmedline.csSiteSpecificFactor17}), RX Summ--Scope Reg LN Sur (${untrimmedline.rxSummScopeRegLnSur})')
                }
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,8")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000,020,030,050,060,080,090,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor17 (${untrimmedline.csSiteSpecificFactor17}), RX Summ--Scope Reg LN Sur (${untrimmedline.rxSummScopeRegLnSur})')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00383; TAG: N1370; NAME: CS SSF 18, MerkelCell Schemas (CS)
    public boolean naaccr00383(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int msg_3325_flag
        
        msg_3325_flag = 0
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988") || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,8")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "000,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor18 (${untrimmedline.csSiteSpecificFactor18}), RX Summ--Scope Reg LN Sur (${untrimmedline.rxSummScopeRegLnSur})')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "000,010")) {
            if ((functions.GEN_INLIST(t_schema_name, "MerkelCellPenis") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,420,999")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,400,999")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellVulva") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,520,999")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,400,480,999"))) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor18 (${untrimmedline.csSiteSpecificFactor18}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
            }
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor18 (${untrimmedline.csSiteSpecificFactor18}), Regional Nodes Positive (${untrimmedline.regionalNodesPositive})')
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "020,090,100,200,300")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'Conflict among schema, CS Site-Specific Factor18 (${untrimmedline.csSiteSpecificFactor18}), CS Lymph Nodes (${untrimmedline.csLymphNodes})')
                    msg_3325_flag = 1
                }
            }
        }
        return true

    }

    // ID: NAACCR-00384; TAG: N1063; NAME: CS SSF 2, Dx Conf, KidneyRenalPelvis (CS)
    public boolean naaccr00384(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000-980,991")) {
            if (!functions.GEN_INLIST(untrimmedline.diagnosticConfirmation, "1")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00385; TAG: N1748; NAME: CS SSF 2, Ext, KidneyRenalPelvis (CS)
    public boolean naaccr00385(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "001-980,991")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "600-810,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00386; TAG: N1767; NAME: CS SSF 2, Extension, KidneyParenchyma Schema (CS)
    public boolean naaccr00386(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "600-999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "020,040,050,070")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "600,610-999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030,060,080,090")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "620-999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00387; TAG: N1555; NAME: CS SSF 2, Extension, Ovary Schema (CS)
    public boolean naaccr00387(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Ovary"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "987")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00388; TAG: N1574; NAME: CS SSF 2, LN, LN Eval, RNP, SmallIntestine (CS)
    public boolean naaccr00388(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "SmallIntestine"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-300") && functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0,1,5") && functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,98,99")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "100,200,400")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00389; TAG: N1556; NAME: CS SSF 2, Lower GI Schemas (CS)
    public boolean naaccr00389(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "SmallIntestine,Appendix,CarcinoidAppendix,Colon,Rectum,NETColon,NETRectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,050")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
                else
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010-400")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
                else
                    return true
            }
        }
        return true

    }

    // ID: NAACCR-00390; TAG: N1749; NAME: CS SSF 2, Lymph Nodes, Bladder (CS)
    public boolean naaccr00390(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Bladder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "001-980,990-997")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "150,250,350-450,505,800")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00391; TAG: N1900; NAME: CS SSF 2, Lymph Nodes, Ovary (CS)
    public boolean naaccr00391(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Ovary"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "100,110,120,130,200,210,220,230"))
                return false
        }
        return true

    }

    // ID: NAACCR-00392; TAG: N1901; NAME: CS SSF 2, Lymph Nodes, PeritoneumFemaleGen (CS)
    public boolean naaccr00392(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500)
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "PeritoneumFemaleGen"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "100,110,120,130,200,210,220,230,310,320"))
                return false
        }
        return true

    }

    // ID: NAACCR-00393; TAG: N1735; NAME: CS SSF 2, Lymph Nodes, Vagina (CS)
    public boolean naaccr00393(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "150,400,425,475")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010"))
                return false
        }
        return true

    }

    // ID: NAACCR-00394; TAG: N1736; NAME: CS SSF 2, Mets at DX, Vagina (CS)
    public boolean naaccr00394(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csMetsAtDx, "20,22")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010"))
                return false
        }
        return true

    }

    // ID: NAACCR-00395; TAG: N1378; NAME: CS SSF 2, MyelomaPlasmaCellDisorder (CS)
    public boolean naaccr00395(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010,020,030,040,050,060,070,080,090,999")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "987")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731,9734")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00396; TAG: N1558; NAME: CS SSF 2, RX Summ--Surg, DX/Stg, Pleura (CS)
    public boolean naaccr00396(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Pleura"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02,05,06", "(\\d\\d)")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00397; TAG: N1750; NAME: CS SSF 2, RX Summ--Surg, Oth, DX/Stg, Lung (CS)
    public boolean naaccr00397(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Lung"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0") && !functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "01,02,04,06")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00398; TAG: N1559; NAME: CS SSF 2, RX Summ--Surg, Pleura (CS)
    public boolean naaccr00398(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Pleura"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00399; TAG: N1737; NAME: CS SSF 2, SSF 3, Vagina (CS)
    public boolean naaccr00399(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Vagina schema: If CS Site-Specific Factor 2 = 998, CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Vagina schema: If CS Site-Specific Factor 3 = 998, CS Site-Specific Factor 2 (${untrimmedline.csSiteSpecificFactor2}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00400; TAG: N1751; NAME: CS SSF 2, Surg, KidneyRenalPelvis (CS)
    public boolean naaccr00400(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00401; TAG: N1782; NAME: CS SSF 2, Surgery, KidneyParenchyma Schema (CS)
    public boolean naaccr00401(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-27"))
                return false
        }
        return true

    }

    // ID: NAACCR-00402; TAG: N1561; NAME: CS SSF 21, TS/Ext Eval, LN Eval, Breast (CS)
    public boolean naaccr00402(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "988") || functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.csLymphNodesEval))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "010,020,030")) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "5,6") && !functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "5,6")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor21 = ${untrimmedline.csSiteSpecificFactor21}, CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}) or CS Lymph Nodes Eval (${untrimmedline.csLymphNodesEval}) must = 5 or 6')
            }
            else
                return true
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "987")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "5,6") || functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "5,6")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor21 = ${untrimmedline.csSiteSpecificFactor21}, both CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}) and CS Lymph Nodes Eval (${untrimmedline.csLymphNodesEval}) must not = 5 or 6')
                }
                else
                    return true
            }
        }
        return true

    }

    // ID: NAACCR-00403; TAG: N1562; NAME: CS SSF 22, SSF 23, Breast (CS)
    public boolean naaccr00403(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor22 = 998, CS Site-Specific Factor23 (${untrimmedline.csSiteSpecificFactor23}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor23 = 998, CS Site-Specific Factor22 (${untrimmedline.csSiteSpecificFactor22}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00404; TAG: N1563; NAME: CS SSF 22, SSF 23, Surgery, DX/Stg, Breast (CS)
    public boolean naaccr00404(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
        
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "998") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If no surgery/BX performed, both CS Site-Specific Factor22 (${untrimmedline.csSiteSpecificFactor22}) and CS Site-Specific Factor23 (${untrimmedline.csSiteSpecificFactor23}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00405; TAG: N1640; NAME: CS SSF 25, PeritoneumFemaleGen (CS)
    public boolean naaccr00405(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year > 2015)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25))
            return true
        if (functions.GEN_INLIST(untrimmedline.sex, "2") && functions.GEN_INLIST(untrimmedline.primarySite, "481,482,488", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576, 8590-8671, 8930-8934,8940-9110")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor25, "002,100"))
                return false
        }
        return true

    }

    // ID: NAACCR-00406; TAG: N0954; NAME: CS SSF 3, RX Summ--SurgMargins, Prost Schema (CS)
    public boolean naaccr00406(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.rxSummSurgicalMargins))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "400,402,404,406,480")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgicalMargins, "1-3"))
                return false
        }
        return true

    }

    // ID: NAACCR-00407; TAG: N0889; NAME: CS SSF 3, Breast Schema (CS)
    public boolean naaccr00407(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.regionalNodesExamined, "00", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "098", "(\\d\\d\\d)"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00408; TAG: N1771; NAME: CS SSF 3, Extension, KidneyParenchyma Schema (CS)
    public boolean naaccr00408(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988") || functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "010,030")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "630-999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "630,640,645")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,020"))
                return functions.GEN_ERROR_MSG(binding, 'KidneyParenchyma schema: If CS Extension = ${untrimmedline.csExtension}, CS Site-Specific Factor 3 must not = ${untrimmedline.csSiteSpecificFactor3}')
        }
        return true

    }

    // ID: NAACCR-00409; TAG: N1752; NAME: CS SSF 3, Lymph Nodes, Bladder (CS)
    public boolean naaccr00409(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Bladder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00410; TAG: N1794; NAME: CS SSF 3, Mets at Dx, KidneyParenchyma Schema (CS)
    public boolean naaccr00410(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988") || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "020,030")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDx, "40,55"))
                return false
        }
        return true

    }

    // ID: NAACCR-00411; TAG: N1379; NAME: CS SSF 3, MyelomaPlasmaCellDisorder (CS)
    public boolean naaccr00411(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,010,020,030,080,100,999")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9732")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "987")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731,9734")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00412; TAG: N1738; NAME: CS SSF 3, RX Summ--Scope Reg LN Sur, Vagina (CS)
    public boolean naaccr00412(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988") || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "030,040")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0"))
                return false
        }
        return true

    }

    // ID: NAACCR-00413; TAG: N0706; NAME: CS SSF 3, RX Summ--Surg, Prostate Schema (CS)
    public boolean naaccr00413(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3)) {
        
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "50,70")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960,970,980,985"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00414; TAG: N0965; NAME: CS SSF 3, SSF 4, Prostate Schema (CS)
    public boolean naaccr00414(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        w_cs_version_1st = functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.csVersionInputOriginal, 1, 4))
        if (w_cs_version_1st < 102)
            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) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                return true
        }
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960, 970, 980")) {
            if (functions.GEN_INLIST(functions.GEN_SUBSTR(untrimmedline.csSiteSpecificFactor4, 2, 1), "5"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00415; TAG: N0953; NAME: CS SSF 3, TS/Ext Eval, Prostate Schema (CS)
    public boolean naaccr00415(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,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
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "4,5,6")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960,970,980,985"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3,8")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960,970,980,990"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "950"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "6")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "950,990"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "950,999")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000-750")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "0-2,5,9"))
                    return functions.GEN_ERROR_MSG(binding, 'Conflict among schema, CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}), CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}), CS Extension (${untrimmedline.csExtension})')
                else
                    return true
            }
            else
                return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "200-240")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960")) {
                    if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "0,9"))
                        return functions.GEN_ERROR_MSG(binding, 'Conflict among schema, CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}), CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}), CS Extension (${untrimmedline.csExtension})')
                }
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "970,980")) {
                    if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "0"))
                        return functions.GEN_ERROR_MSG(binding, 'Conflict among schema, CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}), CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}), CS Extension (${untrimmedline.csExtension})')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "5")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "950,999") && (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "950-990"))) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "200-300") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "300,320,400")))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.csExtension, "200,240,300") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "210-230,330-350,402-406")))
                        return true
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csExtension, "210") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "330,402")))
                            return true
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csExtension, "220") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "330,340,402,404")))
                                return true
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csExtension, "230") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "330,340,350,402,404,406")))
                                    return true
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csExtension, "410-490") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "495")))
                                        return true
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csExtension, "410,490") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "415-490")))
                                            return true
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csExtension, "420-445") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "430-483")))
                                                return true
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.csExtension, "450-470") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "480-483,485-490")))
                                                    return true
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csExtension, "500-700") && (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "510-750")))
                                                        return true
                                                    else {
                                                        if ((functions.GEN_VAL(untrimmedline.csExtension)) < (functions.GEN_VAL(untrimmedline.csSiteSpecificFactor3)))
                                                            return false
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "200-750")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "0,1,9"))
                return false
        }
        return true

    }

    // ID: NAACCR-00416; TAG: N1911; NAME: CS SSF 4, 5, 6, MelanomaSkin (CS)
    public boolean naaccr00416(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaSkin"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 4 = 998, CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5}) and CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6}) must = 998')
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998"))
                    return true
                else
                    return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 5 = 998, CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}) and CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6}) must = 998')
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998"))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 6 = 998, CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}) and CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5}) must = 998')
                }
            }
        }
        
        return true

    }

    // ID: NAACCR-00417; TAG: N1564; NAME: CS SSF 4, CS SSF 5, Liver Schema (CS)
    public boolean naaccr00417(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Liver"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00418; TAG: N1059; NAME: CS SSF 4, LymphNodes, NodesPos, ColoRectal (CS)
    public boolean naaccr00418(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon,Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "001-081, 990")) {
            if (functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "01-97")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "050")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
                else
                    return true
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "050")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00419; TAG: N1739; NAME: CS SSF 4, Mets at DX, Vagina (CS)
    public boolean naaccr00419(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDx, "30,35,55,58"))
                return false
        }
        return true

    }

    // ID: NAACCR-00420; TAG: N0707; NAME: CS SSF 4, RX Summ--Surg, Testis Schema (CS)
    public boolean naaccr00420(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "80,90,99")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000,999"))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "40")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000"))
                    return true
                else
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000")) {
                    if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "40"))
                        return true
                    else
                        return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-00421; TAG: N1740; NAME: CS SSF 4, SSF 5, Vagina (CS)
    public boolean naaccr00421(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Vagina schema: If CS Site-Specific Factor 4 = 998, CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Vagina schema: If CS Site-Specific Factor 5 = 998, CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00422; TAG: N1795; NAME: CS SSF 4, Surg, DX/Stg, KidneyParenchyma (CS)
    public boolean naaccr00422(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02", "(\\d\\d)"))
                return false
        }
        return true

    }

    // ID: NAACCR-00423; TAG: N1783; NAME: CS SSF 4, Surgery, KidneyParenchyma Schema (CS)
    public boolean naaccr00423(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19"))
                return false
        }
        return true

    }

    // ID: NAACCR-00424; TAG: N1912; NAME: CS SSF 5, GISTPeritoneum (CS)
    public boolean naaccr00424(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "GISTPeritoneum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00425; TAG: N1585; NAME: CS SSF 5, Lymph Nodes, Testis (CS)
    public boolean naaccr00425(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 5 = ${untrimmedline.csSiteSpecificFactor5}, CS Lymph Nodes must not = ${untrimmedline.csLymphNodes}')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "010-030")) {
            if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-800")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 5 = ${untrimmedline.csSiteSpecificFactor5}, CS Lymph Nodes must not = ${untrimmedline.csLymphNodes}')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "510")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "010,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, CS Site-Specific Factor 5 must not = ${untrimmedline.csSiteSpecificFactor5}')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "520")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "020,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, CS Site-Specific Factor 5 must not = ${untrimmedline.csSiteSpecificFactor5}')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "530")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "030,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Lymph Nodes = ${untrimmedline.csLymphNodes}, CS Site-Specific Factor 5 must not = ${untrimmedline.csSiteSpecificFactor5}')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00426; TAG: N1118; NAME: CS SSF 5, RX Summ--Surg, ColoRectal (CS)
    public boolean naaccr00426(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon, Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000,010,020,030")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00427; TAG: N1741; NAME: CS SSF 5, SSF 7, RX Summ--Surg Other, Vagina (CS)
    public boolean naaccr00427(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "040") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "040")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0"))
                return false
        }
        return true

    }

    // ID: NAACCR-00428; TAG: N0890; NAME: CS SSF 6, Breast Schema (CS)
    public boolean naaccr00428(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010,987", "(\\d\\d\\d)"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8543"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010", "(\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
                return true
            else {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00429; TAG: N1565; NAME: CS SSF 6, CS SSF 7, Liver Schema (CS)
    public boolean naaccr00429(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Liver"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00430; TAG: N1913; NAME: CS SSF 6, GISTEsoph, SmallIntest, Stomach (CS)
    public boolean naaccr00430(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTSmallIntestine,GISTStomach"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00431; TAG: N1774; NAME: CS SSF 6, Histology, KidneyParenchyma Schema (CS)
    public boolean naaccr00431(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "987")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8260,8310,8312,8316-8320,8510,8959 "))
                return false
        }
        return true

    }

    // ID: NAACCR-00432; TAG: N1742; NAME: CS SSF 6, Mets at DX, Vagina (CS)
    public boolean naaccr00432(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988") || functions.GEN_EMPTY(untrimmedline.csMetsAtDx))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "010")) {
            if (!functions.GEN_INLIST(untrimmedline.csMetsAtDx, "35,55,58"))
                return false
        }
        return true

    }

    // ID: NAACCR-00433; TAG: N1753; NAME: CS SSF 6, RX Summ--Surg, ColoRectal (CS)
    public boolean naaccr00433(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int dx_year
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon,Rectum"))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, CS Site-Specific Factor 6 must = 998')
                }
            }
        }
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20500) || (dx_year > 2015)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-29")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998,999")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, CS Site-Specific Factor 6 must = 998 or 999')
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "99")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, CS Site-Specific Factor 6 must = 999')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000-981,990-996")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 6 = ${untrimmedline.csSiteSpecificFactor6}, RX Summ--Surg Prim Site must not = 00, 99, or blank')
            }
        }
        return true

    }

    // ID: NAACCR-00434; TAG: N1586; NAME: CS SSF 6, SSF 12, Testis (CS)
    public boolean naaccr00434(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "995,996")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 6 = ${untrimmedline.csSiteSpecificFactor6}, CS Site-Specific Factor12 must not = ${untrimmedline.csSiteSpecificFactor12}')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00435; TAG: N1587; NAME: CS SSF 6, SSF 7, Testis (CS)
    public boolean naaccr00435(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 6 = 998, CS Site-Specific Factor 7 (${untrimmedline.csSiteSpecificFactor7}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 7 = 998, CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00436; TAG: N1743; NAME: CS SSF 6, SSF 7, Vagina (CS)
    public boolean naaccr00436(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Vagina schema: If CS Site-Specific Factor 6 = 998, CS Site-Specific Factor 7 (${untrimmedline.csSiteSpecificFactor7}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Vagina schema: If CS Site-Specific Factor 7 = 998, CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00437; TAG: N1026; NAME: CS SSF 6, Tumor Size, Breast Schema (CS)
    public boolean naaccr00437(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_EMPTY(untrimmedline.csTumorSize))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "020,030,040,050", "(\\d\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSize, "999"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "060", "(\\d\\d\\d)")) {
                if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "999"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00438; TAG: N1722; NAME: CS SSF 7, 8, 12, 13, Prostate Schema (CS)
    public boolean naaccr00438(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998") && functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-17")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998"))
                return true
            else
                return functions.GEN_ERROR_MSG(binding, 'Prostate schema: If CS Site-Specific Factor12 and CS Site-Specific Factor13 =998 and RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite}, CS Site-Specific Factor 7 and CS Site-Specific Factor 8 must also = 998')
        }
        
        return true

    }

    // ID: NAACCR-00439; TAG: N1914; NAME: CS SSF 7, MelanomaSkin (CS)
    public boolean naaccr00439(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20500) && (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaSkin"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-19"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00440; TAG: N1588; NAME: CS SSF 7, SSF 13, Testis (CS)
    public boolean naaccr00440(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "995,996")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 7 = ${untrimmedline.csSiteSpecificFactor7}, CS Site-Specific Factor13 must not = ${untrimmedline.csSiteSpecificFactor13}')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00441; TAG: N1754; NAME: CS SSF 7, SSF 8, Prostate Schema (CS)
    public boolean naaccr00441(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "998"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "011")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "002"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "012")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "003"))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "013")) {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "004"))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "014")) {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "005"))
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "015")) {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "006"))
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "019")) {
                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "002-006,999"))
                                    return false
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "021")) {
                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "003"))
                                        return false
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "022")) {
                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "004"))
                                            return false
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "023")) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "005"))
                                                return false
                                        }
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "024")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "006"))
                                                    return false
                                            }
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "025")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007"))
                                                        return false
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "029")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "003-007,999"))
                                                            return false
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "031")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "004"))
                                                                return false
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "032")) {
                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "005"))
                                                                    return false
                                                            }
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "033")) {
                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "006"))
                                                                        return false
                                                                }
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "034")) {
                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007"))
                                                                            return false
                                                                    }
                                                                    else {
                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "035")) {
                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "008"))
                                                                                return false
                                                                        }
                                                                        else {
                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "039")) {
                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "004-008,999"))
                                                                                    return false
                                                                            }
                                                                            else {
                                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "041")) {
                                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "005"))
                                                                                        return false
                                                                                }
                                                                                else {
                                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "042")) {
                                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "006"))
                                                                                            return false
                                                                                    }
                                                                                    else {
                                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "043")) {
                                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007"))
                                                                                                return false
                                                                                        }
                                                                                        else {
                                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "044")) {
                                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "008"))
                                                                                                    return false
                                                                                            }
                                                                                            else {
                                                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "045")) {
                                                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "009"))
                                                                                                        return false
                                                                                                }
                                                                                                else {
                                                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "049")) {
                                                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "005-009,999"))
                                                                                                            return false
                                                                                                    }
                                                                                                    else {
                                                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "051")) {
                                                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "006"))
                                                                                                                return false
                                                                                                        }
                                                                                                        else {
                                                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "052")) {
                                                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "007"))
                                                                                                                    return false
                                                                                                            }
                                                                                                            else {
                                                                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "053")) {
                                                                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "008"))
                                                                                                                        return false
                                                                                                                }
                                                                                                                else {
                                                                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "054")) {
                                                                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "009"))
                                                                                                                            return false
                                                                                                                    }
                                                                                                                    else {
                                                                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "055")) {
                                                                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "010"))
                                                                                                                                return false
                                                                                                                        }
                                                                                                                        else {
                                                                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "059")) {
                                                                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "006-010,999"))
                                                                                                                                    return false
                                                                                                                            }
                                                                                                                            else
                                                                                                                                return true
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        
        return true

    }

    // ID: NAACCR-00442; TAG: N1566; NAME: CS SSF 8, CS SSF 9, Breast (CS)
    public boolean naaccr00442(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor 8 = 998, CS Site-Specific Factor 9 (${untrimmedline.csSiteSpecificFactor9}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Site-Specific Factor 9 = 998, CS Site-Specific Factor 8 (${untrimmedline.csSiteSpecificFactor8}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00443; TAG: N1567; NAME: CS SSF 8, CS SSF 9, Surgery, DX/Stg, Breast (CS)
    public boolean naaccr00443(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur) || functions.GEN_EMPTY(untrimmedline.rxSummSurgOthRegDis))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00") && functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "00") && functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0") && functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
        
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'If no surgery/BX performed, both CS Site-Specific Factor 8 (${untrimmedline.csSiteSpecificFactor8}) and CS Site-Specific Factor 9 (${untrimmedline.csSiteSpecificFactor9}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00444; TAG: N1775; NAME: CS SSF 8, Lymph Nodes, KidneyParenchyma (CS)
    public boolean naaccr00444(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || functions.GEN_EMPTY(untrimmedline.csLymphNodes))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-800"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "010-030"))
                return functions.GEN_ERROR_MSG(binding, 'KidneyParenchyma schema: If CS Lymph Nodes = 000, CS Site-Specific Factor 8 (${untrimmedline.csSiteSpecificFactor8}) must not = 010-030')
        }
        return true

    }

    // ID: NAACCR-00445; TAG: N1568; NAME: CS SSF 8, RX Summ--Surg, ColoRectal (CS)
    public boolean naaccr00445(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon,Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00446; TAG: N1569; NAME: CS SSF 8, RX Summ--Surg, DX/Stg, ColoRectal (CS)
    public boolean naaccr00446(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummDxStgProc))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Colon,Rectum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "20-89") || functions.GEN_INLIST(untrimmedline.rxSummDxStgProc, "02,05,06", "(\\d\\d)")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00447; TAG: N1589; NAME: CS SSF 8, SSF 14, Testis (CS)
    public boolean naaccr00447(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "995,996")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 8 = ${untrimmedline.csSiteSpecificFactor8}, CS Site-Specific Factor14 must not = ${untrimmedline.csSiteSpecificFactor14}')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00448; TAG: N1590; NAME: CS SSF 8, SSF 9, Testis (CS)
    public boolean naaccr00448(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988") || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 8 = 998, CS Site-Specific Factor 9 (${untrimmedline.csSiteSpecificFactor9}) must = 998')
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "998")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 9 = 998, CS Site-Specific Factor 8 (${untrimmedline.csSiteSpecificFactor8}) must = 998')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00449; TAG: N1634; NAME: CS SSF 9, Head and Neck Schemas (CS)
    public boolean naaccr00449(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || functions.GEN_EMPTY(untrimmedline.regionalNodesPositive) || functions.GEN_EMPTY(untrimmedline.rxSummScopeRegLnSur))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "00,95,98")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "999")) {
            if (!functions.GEN_INLIST(untrimmedline.regionalNodesPositive, "98,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00450; TAG: N1755; NAME: CS SSF 9, SSF 10, Prostate Schema (CS)
    public boolean naaccr00450(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int w_cs_version_1st
        int dx_year
        
        if (dx_year < 2003) {
            if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30,50,70,80,99") && !functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") && !functions.GEN_EMPTY(untrimmedline.typeOfReportingSource) && !functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3,8,9") && !functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998") || !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "998"))
                return functions.GEN_ERROR_MSG(binding, 'For RX Summ--Surg Prim Site of ${untrimmedline.rxSummSurgPrimSite}/Type of Reporting Source of ${untrimmedline.typeOfReportingSource}/CS Tumor Size/Ext Eval of ${untrimmedline.csTumorSizeExtEval}, CS Site-Specific Factor 9 (${untrimmedline.csSiteSpecificFactor9}) and CS Site-Specific Factor10 (${untrimmedline.csSiteSpecificFactor10}) must = 998')
            else
                return true
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30,50,70,80") || functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6") || functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3,8")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998") || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "998"))
                    return functions.GEN_ERROR_MSG(binding, 'For RX Summ--Surg Prim Site of ${untrimmedline.rxSummSurgPrimSite}/Type of Reporting Source of ${untrimmedline.typeOfReportingSource}/CS Tumor Size/Ext Eval of ${untrimmedline.csTumorSizeExtEval}, CS Site-Specific Factor 9 (${untrimmedline.csSiteSpecificFactor9}) and CS Site-Specific Factor10 (${untrimmedline.csSiteSpecificFactor10}) must not = 998')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "011")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "012")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "003"))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "013")) {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "004"))
                        return false
                }
                else {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "014")) {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "005"))
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "015")) {
                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "006"))
                                return false
                        }
                        else {
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "019")) {
                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "002-006,999"))
                                    return false
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "021")) {
                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "003"))
                                        return false
                                }
                                else {
                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "022")) {
                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "004"))
                                            return false
                                    }
                                    else {
                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "023")) {
                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "005"))
                                                return false
                                        }
                                        else {
                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "024")) {
                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "006"))
                                                    return false
                                            }
                                            else {
                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "025")) {
                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007"))
                                                        return false
                                                }
                                                else {
                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "029")) {
                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "003-007,999"))
                                                            return false
                                                    }
                                                    else {
                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "031")) {
                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "004"))
                                                                return false
                                                        }
                                                        else {
                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "032")) {
                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "005"))
                                                                    return false
                                                            }
                                                            else {
                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "033")) {
                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "006"))
                                                                        return false
                                                                }
                                                                else {
                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "034")) {
                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007"))
                                                                            return false
                                                                    }
                                                                    else {
                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "035")) {
                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008"))
                                                                                return false
                                                                        }
                                                                        else {
                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "039")) {
                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "004-008,999"))
                                                                                    return false
                                                                            }
                                                                            else {
                                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "041")) {
                                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "005"))
                                                                                        return false
                                                                                }
                                                                                else {
                                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "042")) {
                                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "006"))
                                                                                            return false
                                                                                    }
                                                                                    else {
                                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "043")) {
                                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007"))
                                                                                                return false
                                                                                        }
                                                                                        else {
                                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "044")) {
                                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008"))
                                                                                                    return false
                                                                                            }
                                                                                            else {
                                                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "045")) {
                                                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "009"))
                                                                                                        return false
                                                                                                }
                                                                                                else {
                                                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "049")) {
                                                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "005-009,999"))
                                                                                                            return false
                                                                                                    }
                                                                                                    else {
                                                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "051")) {
                                                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "006"))
                                                                                                                return false
                                                                                                        }
                                                                                                        else {
                                                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "052")) {
                                                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "007"))
                                                                                                                    return false
                                                                                                            }
                                                                                                            else {
                                                                                                                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "053")) {
                                                                                                                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "008"))
                                                                                                                        return false
                                                                                                                }
                                                                                                                else {
                                                                                                                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "054")) {
                                                                                                                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "009"))
                                                                                                                            return false
                                                                                                                    }
                                                                                                                    else {
                                                                                                                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "055")) {
                                                                                                                            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "010"))
                                                                                                                                return false
                                                                                                                        }
                                                                                                                        else {
                                                                                                                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "059")) {
                                                                                                                                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "006-010,999"))
                                                                                                                                    return false
                                                                                                                            }
                                                                                                                            else
                                                                                                                                return true
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        
        return true

    }

    // ID: NAACCR-00451; TAG: N1591; NAME: CS SSF 9, SSF 15, Testis (CS)
    public boolean naaccr00451(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "995,996")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "998,999")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'Testis schema: If CS Site-Specific Factor 9 = ${untrimmedline.csSiteSpecificFactor9}, CS Site-Specific Factor15 must not = ${untrimmedline.csSiteSpecificFactor15}')
            }
            else
                return true
        }
        return true

    }

    // ID: NAACCR-00452; TAG: N1779; NAME: CS SSF 9, Surgery, MelanomaChor/Cil/Iris (CS)
    public boolean naaccr00452(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988") || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "998")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-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 false
            }
        }
        return true

    }

    // ID: NAACCR-00453; TAG: N1639; NAME: CS Schema, Path Grade System, Grade (CS)
    public boolean naaccr00453(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)))
            return true
        if (dx_year < 2012)
            return true
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension)))
            return true
        if (!functions.GEN_INLIST(untrimmedline.grade, "9") || !functions.GEN_INLIST(untrimmedline.gradePathSystem, "3,4"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Bone,Esophagus,EsophagusGEJunction,HeartMediastinum,Penis") && !functions.GEN_INLIST(t_schema_name, "Peritoneum,Prostate,Retroperitoneum,SoftTissue,Thyroid"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "Bone")) {
            if (functions.GEN_INLIST(untrimmedline.gradePathSystem, "4") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'A known grade/differentiation [440] code is required for CS staging')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Esophagus")) {
            if (functions.GEN_INLIST(untrimmedline.gradePathSystem, "4") && functions.GEN_INLIST(untrimmedline.csExtension, "000-450") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'A known grade/differentiation [440] code is required for CS staging')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "EsophagusGEJunction")) {
            if (functions.GEN_INLIST(untrimmedline.gradePathSystem, "4") && functions.GEN_INLIST(untrimmedline.csExtension, "000-480") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'A known grade/differentiation [440] code is required for CS staging')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "HeartMediastinum,Peritoneum,Retroperitoneum,SoftTissue")) {
            if (functions.GEN_INLIST(untrimmedline.gradePathSystem, "3,4") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'A known grade/differentiation [440] code is required for CS staging')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Penis")) {
            if (functions.GEN_INLIST(untrimmedline.gradePathSystem, "4") && functions.GEN_INLIST(untrimmedline.csExtension, "100-320") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'A known grade/differentiation [440] code is required for CS staging')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
            if (functions.GEN_INLIST(untrimmedline.gradePathSystem, "4") && functions.GEN_INLIST(untrimmedline.csExtension, "130") && functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00,99")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'A known grade/differentiation [440] code is required for CS staging')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Thyroid") && functions.GEN_INLIST(untrimmedline.gradePathSystem, "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, 'A known grade/differentiation [440] code is required for CS staging')
        }
        return true

    }

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

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-00458; TAG: N0664; NAME: CS Site-Specific Factor 3 (CS)
    public boolean naaccr00458(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor3, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00460; TAG: N0665; NAME: CS Site-Specific Factor 4 (CS)
    public boolean naaccr00460(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor4, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00462; TAG: N0666; NAME: CS Site-Specific Factor 5 (CS)
    public boolean naaccr00462(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor5, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00464; TAG: N0667; NAME: CS Site-Specific Factor 6 (CS)
    public boolean naaccr00464(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor6, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00466; TAG: N0995; NAME: CS Site-Specific Factor 7 (CS)
    public boolean naaccr00466(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor7, "(\\d\\d\\d)")

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-00470; TAG: N0997; NAME: CS Site-Specific Factor 9 (CS)
    public boolean naaccr00470(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor9, "(\\d\\d\\d)")

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-00474; TAG: N0999; NAME: CS Site-Specific Factor11 (CS)
    public boolean naaccr00474(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor11, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00476; TAG: N1000; NAME: CS Site-Specific Factor12 (CS)
    public boolean naaccr00476(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor12, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00478; TAG: N1001; NAME: CS Site-Specific Factor13 (CS)
    public boolean naaccr00478(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor13, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00480; TAG: N1002; NAME: CS Site-Specific Factor14 (CS)
    public boolean naaccr00480(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor14, "(\\d\\d\\d)")

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-00484; TAG: N1004; NAME: CS Site-Specific Factor16 (CS)
    public boolean naaccr00484(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor16, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00486; TAG: N1005; NAME: CS Site-Specific Factor17 (CS)
    public boolean naaccr00486(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor17, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00488; TAG: N1006; NAME: CS Site-Specific Factor18 (CS)
    public boolean naaccr00488(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor18, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00490; TAG: N1007; NAME: CS Site-Specific Factor19 (CS)
    public boolean naaccr00490(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor19, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00492; TAG: N1008; NAME: CS Site-Specific Factor20 (CS)
    public boolean naaccr00492(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor20, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00494; TAG: N1009; NAME: CS Site-Specific Factor21 (CS)
    public boolean naaccr00494(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor21, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00496; TAG: N1010; NAME: CS Site-Specific Factor22 (CS)
    public boolean naaccr00496(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor22, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00498; TAG: N1011; NAME: CS Site-Specific Factor23 (CS)
    public boolean naaccr00498(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor23, "(\\d\\d\\d)")

    }

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

    }

    // ID: NAACCR-00500; TAG: N1012; NAME: CS Site-Specific Factor24 (CS)
    public boolean naaccr00500(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24))
            return true
        return functions.GEN_MATCH(untrimmedline.csSiteSpecificFactor24, "(\\d\\d\\d)")

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-00504; TAG: N1578; NAME: CS TS/Ext Eval, Surg/Rad Seq, Prostate (CS)
    public boolean naaccr00504(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.rxSummSurgRadSeq))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "4")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "2,4"))
                return false
        }
        return true

    }

    // ID: NAACCR-00505; TAG: N1579; NAME: CS TS/Ext Eval, Sys/Surg Seq, Prostate (CS)
    public boolean naaccr00505(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.rxSummSystemicSurSeq))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "4")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "2,4"))
                return false
        }
        return true

    }

    // ID: NAACCR-00506; TAG: N1027; NAME: CS TS/Ext Eval, Surgery, Bladder Schema (CS)
    public boolean naaccr00506(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Bladder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "10-27")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "700-805")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "5,6,8"))
                    return false
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3,5,6,8"))
                    return functions.GEN_ERROR_MSG(binding, 'If RX Summ--Surg Prim Site = ${untrimmedline.rxSummSurgPrimSite} and CS Extension = ${untrimmedline.csExtension}, CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}) must not = 3, 5, 6, or 8')
            }
        }
        return true

    }

    // ID: NAACCR-00507; TAG: N0898; NAME: CS TS/Ext Eval, Surgery, Prostate Schema (CS)
    public boolean naaccr00507(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) || functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "22")) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "1,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 false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "19-26")) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "0,1,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 false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "4,5,6")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "30-80")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        return true

    }

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

    }

    // ID: NAACCR-00509; TAG: N0684; NAME: CS Tumor Size, SSF 1, MelanomaConjunctiva (CS)
    public boolean naaccr00509(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSize))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (!functions.GEN_INLIST(t_schema_name, "MelanomaConjunctiva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSize, "000", "(\\d\\d\\d)") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
            return false
        else {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000") && !functions.GEN_INLIST(untrimmedline.csTumorSize, "000", "(\\d\\d\\d)"))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-00511; TAG: N0719; NAME: CS Tumor Size, Site, Histol ICDO3 (CS)
    public boolean naaccr00511(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        
        if (functions.GEN_EMPTY(untrimmedline.csTumorSize))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSize, "998")) {
                if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8220,8221"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8220,8221")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "998"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "IllDefinedOther")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "809", "(C\\d\\d\\d)", 2, 3)) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "999"))
                    return true
                else {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return functions.GEN_ERROR_MSG(binding, 'For Primary Site of ${untrimmedline.primarySite}, CS Tumor Size must = 999')
                }
            }
        }
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00514; TAG: N1317; NAME: CS Validate Schema (CS)
    public boolean naaccr00514(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.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 (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00515; TAG: N1797; NAME: CS Validate Schema (NPCR)
    public boolean naaccr00515(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        char[] t_schema_str = new char[4]
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.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 (functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1") && (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7")) && (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0) {
            functions.GEN_ERROR_TEXT(binding, 'Invalid site or histology')
            return false
        }
        else {
            if (t_schema_number > t_max_schemas) {
                functions.GEN_ERROR_TEXT(binding, 'Schema discriminator missing or invalid')
                return false
            }
        }
        return true

    }

    // ID: NAACCR-00516; TAG: N1800; NAME: CS Verify CStage Version 0205xx (CS)
    public boolean naaccr00516(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_cs_version = new char[7]
        int t_compare
        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 > 2017)
            return true
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_version", t_cs_version)
        
        t_compare = functions.GEN_STRCMP(t_cs_version, "0205", 4)
        if (t_compare == 0)
            return true
        return false

    }

    // ID: NAACCR-00517; TAG: N0695; NAME: CS Version Derived (CS)
    public boolean naaccr00517(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_cs_version = new char[7]
        int t_compare
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionDerived))
            return true
        if (!functions.GEN_INLIST(untrimmedline.csVersionDerived, "0205", "(\\d\\d\\d\\d\\d\\d)", 1, 4))
            return false
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_version", t_cs_version)
        
        t_compare = functions.GEN_STRCMP(untrimmedline.csVersionDerived, t_cs_version)
        if (t_compare <= 0)
            return true
        return functions.GEN_ERROR_MSG(binding, 'CS Version Derived must be < or = version returned from function call; contact your vendor')

    }

    // ID: NAACCR-00518; TAG: N1212; NAME: CS Version Input Current (CS)
    public boolean naaccr00518(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_cs_version = new char[7]
        int t_compare
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        if (functions.GEN_INLIST(untrimmedline.csVersionInputCurrent, "020550,020540,020530,020520,020510"))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) < 20550)
            return false
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_version", t_cs_version)
        t_compare = functions.GEN_STRCMP(untrimmedline.csVersionInputCurrent, t_cs_version)
        if (t_compare > 0)
            return false
        return true

    }

    // ID: NAACCR-00519; TAG: N1214; NAME: CS Version Input Current, CS Version Derived (CS)
    public boolean naaccr00519(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent) || functions.GEN_EMPTY(untrimmedline.csVersionDerived))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) <= functions.GEN_VAL(untrimmedline.csVersionDerived))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00520; TAG: N0696; NAME: CS Version Input Original (CS)
    public boolean naaccr00520(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_cs_version = new char[7]
        int t_compare
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal))
            return true
        if (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "020550,020440,020302,020200,020100,020001,010401,010400,010300"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "010200,010100,010005,010004,010003,010002,010000,000937"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0205", "(\\d\\d\\d\\d\\d\\d)", 1, 4)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550)
                return false
            functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_version", t_cs_version)
            t_compare = functions.GEN_STRCMP(untrimmedline.csVersionInputOriginal, t_cs_version)
            if (t_compare <= 0)
                return true
        }
        return false

    }

    // ID: NAACCR-00521; TAG: N0774; NAME: CS Version Input Original, CS Version Derived (CS)
    public boolean naaccr00521(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionDerived))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) <= functions.GEN_VAL(untrimmedline.csVersionDerived))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00522; TAG: N1213; NAME: CS Version Input Original, Version Input Curr (CS)
    public boolean naaccr00522(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        if (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) <= functions.GEN_VAL(untrimmedline.csVersionInputCurrent))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00523; TAG: N0088; NAME: Cancer Status (COC)
    public boolean naaccr00523(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.cancerStatus, "1,2,9")

    }

    // ID: NAACCR-00524; TAG: N1228; NAME: Cancer Status (NAACCR)
    public boolean naaccr00524(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.cancerStatus))
            return true
        return functions.GEN_INLIST(untrimmedline.cancerStatus, "1,2,9")

    }

    // ID: NAACCR-00525; TAG: N0742; NAME: Casefinding Source (NAACCR)
    public boolean naaccr00525(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.casefindingSource))
            return true
        return functions.GEN_INLIST(untrimmedline.casefindingSource, "10,20-30,40,50,60,70,75,80,85,90,95,99", "(\\d\\d)")

    }

    // ID: NAACCR-00526; TAG: N0793; NAME: Casefinding Source, Date of DX (SEER IF153)
    public boolean naaccr00526(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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.casefindingSource))
                return false
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.casefindingSource))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Casefinding Source must be blank')
        }
        return true

    }

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

    }

    // ID: NAACCR-00528; TAG: N0091; NAME: Cause of Death (SEER COD)
    public boolean naaccr00528(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_MATCH(untrimmedline.causeOfDeath, "(\\d\\d\\d\\d)") || functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\d)") || functions.GEN_MATCH(untrimmedline.causeOfDeath, "([A-Z]\\d\\d\\s)"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00529; TAG: N0918; NAME: Census Block Group 2000 (NAACCR)
    public boolean naaccr00529(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusBlockGroup2000))
            return true
        return functions.GEN_INLIST(untrimmedline.censusBlockGroup2000, "0-9")

    }

    // ID: NAACCR-00530; TAG: N1376; NAME: Census Block Group 2010 (NAACCR)
    public boolean naaccr00530(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusBlockGroup2010))
            return true
        return functions.GEN_INLIST(untrimmedline.censusBlockGroup2010, "0-9")

    }

    // ID: NAACCR-00531; TAG: N0919; NAME: Census Block Grp 1970-90 (NAACCR)
    public boolean naaccr00531(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusBlockGrp197090))
            return true
        return functions.GEN_INLIST(untrimmedline.censusBlockGrp197090, "0-9")

    }

    // ID: NAACCR-00532; TAG: N0041; NAME: Census Cod Sys 1970/80/90 (SEER RESSYST)
    public boolean naaccr00532(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusCodSys19708090))
            return true
        return functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "0-3")

    }

    // ID: NAACCR-00533; TAG: N0310; NAME: Census Cod Sys 1970/80/90, Date of Diag (SEER IF49)
    public boolean naaccr00533(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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.censusCodSys19708090))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "29,33,37,42,43,44,51", "(00000015\\d\\d)", 9, 2))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "22", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.countyAtDx, "017,049,181")) {
            if ((dx_year > 1972) && (dx_year < 1978)) {
                if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "0"))
                    return true
                else
                    return false
            }
            else {
                if ((dx_year > 1977) && (dx_year < 1988)) {
                    if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "0,2"))
                        return true
                    else
                        return false
                }
                else {
                    if (dx_year > 1987) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "3"))
                            return true
                        else
                            return false
                    }
                    else
                        return true
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.registryId, "23", "(00000015\\d\\d)", 9, 2)) {
                if ((dx_year > 1972) && (dx_year < 1978)) {
                    if (functions.GEN_INLIST(untrimmedline.countyAtDx, "001, 043")) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "1"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "0"))
                            return true
                        else
                            return false
                    }
                }
                else {
                    if ((dx_year > 1977) && (dx_year < 1988)) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "2"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (dx_year > 1987) {
                            if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "3"))
                                return true
                            else
                                return false
                        }
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.registryId, "01,02,20,21,23,27,31,35", "(00000015\\d\\d)", 9, 2) || (functions.GEN_INLIST(untrimmedline.registryId, "22", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.countyAtDx, "013,061,103,113,153,155,163,193")) || (functions.GEN_INLIST(untrimmedline.registryId, "25", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.countyAtDx, "033,035,053,061,067,073")) || (functions.GEN_INLIST(untrimmedline.registryId, "26", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.countyAtDx, "057,011,035,049")) || (functions.GEN_INLIST(untrimmedline.registryId, "26", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.countyAtDx, "045") && (dx_year > 1977))) {
                    if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "0"))
                        return false
                    else {
                        if ((dx_year > 1972) && (dx_year < 1978)) {
                            if (!(functions.GEN_INLIST(untrimmedline.registryId, "25", "(00000015\\d\\d)", 9, 2) && functions.GEN_INLIST(untrimmedline.countyAtDx, "035,067,073"))) {
                                if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "1"))
                                    return true
                                else
                                    return false
                            }
                            else {
                                if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "2"))
                                    return true
                                else
                                    return false
                            }
                        }
                        else {
                            if ((dx_year > 1977) && (dx_year < 1988)) {
                                if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "2"))
                                    return true
                                else
                                    return false
                            }
                            else {
                                if (dx_year > 1987) {
                                    if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "2,3"))
                                        return true
                                    else
                                        return false
                                }
                            }
                        }
                    }
                }
                else {
                    if (dx_year > 1987) {
                        if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "3"))
                            return true
                        else
                            return false
                    }
                    else {
                        if (functions.GEN_INLIST(untrimmedline.censusCodSys19708090, "0"))
                            return true
                        else
                            return false
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00534; TAG: N0163; NAME: Census Ind Code 1970-2000 vs. Coding System (NPCR)
    public boolean naaccr00534(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.censusOccIndSys7000, "3")) {
            if (functions.GEN_EMPTY(untrimmedline.censusIndCode19702000))
                return true
            if (!functions.GEN_LOOKUP(untrimmedline.censusIndCode19702000, context.NAACCR_IND_1990, context.NAACCR_IND_1990_CODE, [:]))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.censusOccIndSys7000, "4")) {
                if (functions.GEN_EMPTY(untrimmedline.censusIndCode19702000))
                    return true
                if (!functions.GEN_LOOKUP(untrimmedline.censusIndCode19702000, context.NAACCR_IND_2000, context.NAACCR_IND_2000_CODE, [:]))
                    return false
            }
        }
        
        return true

    }

    // ID: NAACCR-00536; TAG: N0166; NAME: Census Occ Code 1970-2000 vs. Coding System (NPCR)
    public boolean naaccr00536(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.censusOccIndSys7000, "3")) {
            if (functions.GEN_EMPTY(untrimmedline.censusOccCode19702000))
                return true
            if (!functions.GEN_LOOKUP(untrimmedline.censusOccCode19702000, context.NAACCR_OCC_1990, context.NAACCR_OCC_1990_CODE, [:]))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.censusOccIndSys7000, "4")) {
                if (functions.GEN_EMPTY(untrimmedline.censusOccCode19702000))
                    return true
                if (!functions.GEN_LOOKUP(untrimmedline.censusOccCode19702000, context.NAACCR_OCC_2000, context.NAACCR_OCC_2000_CODE, [:]))
                    return false
            }
        }
        
        return true

    }

    // ID: NAACCR-00538; TAG: N0165; NAME: Census Occ/Ind Sys 70-00 (NPCR)
    public boolean naaccr00538(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusOccIndSys7000))
            return true
        if (functions.GEN_INLIST(untrimmedline.censusOccIndSys7000, "1-5,7,9", "(\\d)"))
            return true
        return false

    }

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

    }

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

    }

    // ID: NAACCR-00541; TAG: N0734; NAME: Census Tr Certainty 2000, Date of DX (SEER IF112)
    public boolean naaccr00541(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001533", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000))
                return true
        }
        if ((dx_year > 1995) && (dx_year < 2001)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTrCertainty2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return true
            }
        }
        if ((dx_year > 2000) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTrCertainty2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        if ((dx_year > 1995) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTrCertainty2000)) {
                if (!functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        else
            return true
        
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00544; TAG: N1801; NAME: Census Tr Poverty Indictr, Date of DX (NPCR)
    public boolean naaccr00544(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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 > 2013) {
            if (functions.GEN_EMPTY(untrimmedline.censusTrPovertyIndictr))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00545; TAG: N1691; NAME: Census Tr Poverty Indictr, Date of DX (SEER)
    public boolean naaccr00545(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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 > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.censusTrPovertyIndictr))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00546; TAG: N0040; NAME: Census Tract 1970/80/90 (SEER TRACT)
    public boolean naaccr00546(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract19708090))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusTract19708090, "000000, 000100-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return false
        return true

    }

    // ID: NAACCR-00547; TAG: N0042; NAME: Census Tract 1970/80/90, Census Cod Sys (SEER IF45)
    public boolean naaccr00547(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract19708090)) {
            if (functions.GEN_EMPTY(untrimmedline.censusCodSys19708090))
                return true
            else
                return false
        }
        if (functions.GEN_EMPTY(untrimmedline.censusCodSys19708090)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract19708090))
                return true
            else
                return false
        }
        if ((functions.GEN_VAL(untrimmedline.censusTract19708090) == 0 && functions.GEN_VAL(untrimmedline.censusCodSys19708090) > 0) || (functions.GEN_VAL(untrimmedline.censusTract19708090) > 0 && functions.GEN_VAL(untrimmedline.censusCodSys19708090) == 0))
            return false
        return true

    }

    // ID: NAACCR-00548; TAG: N0176; NAME: Census Tract 2000 (SEER)
    public boolean naaccr00548(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2000))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusTract2000, "000000, 000100-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return false
        return true

    }

    // ID: NAACCR-00549; TAG: N0733; NAME: Census Tract 2000, Date of DX (SEER IF111)
    public boolean naaccr00549(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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) && (dx_year < 2001)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return true
            }
        }
        if ((dx_year > 2000) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000)) {
                if (functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        if ((dx_year > 1995) && (dx_year < 2012)) {
            if (functions.GEN_EMPTY(untrimmedline.censusTract2000)) {
                if (!functions.GEN_INLIST(untrimmedline.registryId, "0000001541-0000001544", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
                    return false
            }
        }
        else
            return true
        
        return true

    }

    // ID: NAACCR-00550; TAG: N1796; NAME: Census Tract 2000, State, County at DX (NPCR)
    public boolean naaccr00550(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state_cnty_tract = new char[12]
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2000) || functions.GEN_INLIST(untrimmedline.censusTract2000, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addrAtDxState) || functions.GEN_EMPTY(untrimmedline.countyAtDx) || functions.GEN_INLIST(untrimmedline.countyAtDx, "998,999"))
            return true
        functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addrAtDxState)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.countyAtDx)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2000)
        
        if (!functions.GEN_LOOKUP(state_cnty_tract, context.NAACCR_TRAC2000, context.NAACCR_TRAC2000_STCNTYTRAC, [:]))
            return false
        return true

    }

    // ID: NAACCR-00551; TAG: N1375; NAME: Census Tract 2010 (SEER)
    public boolean naaccr00551(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2010))
            return true
        if (!functions.GEN_INLIST(untrimmedline.censusTract2010, "000000, 000100-999999", "(\\d\\d\\d\\d\\d\\d)"))
            return false
        return true

    }

    // ID: NAACCR-00552; TAG: N1786; NAME: Census Tract 2010, State, County at DX (NPCR)
    public boolean naaccr00552(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state_cnty_tract = new char[12]
        
        if (functions.GEN_EMPTY(untrimmedline.censusTract2010) || functions.GEN_INLIST(untrimmedline.censusTract2010, "000000,999999") || functions.GEN_EMPTY(untrimmedline.addrAtDxState) || functions.GEN_EMPTY(untrimmedline.countyAtDx) || functions.GEN_INLIST(untrimmedline.countyAtDx, "998,999"))
            return true
        functions.GEN_STRCPY(state_cnty_tract, untrimmedline.addrAtDxState)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.countyAtDx)
        functions.GEN_STRCAT(state_cnty_tract, untrimmedline.censusTract2010)
        
        if (!functions.GEN_LOOKUP(state_cnty_tract, context.NAACCR_TRAC2010, context.NAACCR_TRAC2010_STCNTYTRAC, [:]))
            return false
        return true

    }

    // ID: NAACCR-00553; TAG: N0630; NAME: Cervix In Situ ICDO3 (SEER IF88)
    public boolean naaccr00553(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.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) && (dx_year < 2003)) && functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2") && functions.GEN_VAL(untrimmedline.histologicTypeIcdO3) < 9590) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "98"))
                return true
            else
                return false
        }
        if (functions.GEN_VAL(untrimmedline.sequenceNumberCentral) == 98) {
            if (((dx_year > 1995) && (dx_year < 2003)) && functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2") && functions.GEN_VAL(untrimmedline.histologicTypeIcdO3) < 9590)
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00554; TAG: N0043; NAME: Class of Case (COC)
    public boolean naaccr00554(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "00, 10-14, 20-22, 30-38, 40-43, 49, 99"))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00555; TAG: N0829; NAME: Class of Case, RX (COC)
    public boolean naaccr00555(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "00"))
            return true
        if (functions.GEN_INLIST(untrimmedline.rxHospBrm, "01") || functions.GEN_INLIST(untrimmedline.rxHospChemo, "01,02,03") || functions.GEN_INLIST(untrimmedline.rxHospHormone, "01") || functions.GEN_INLIST(untrimmedline.rxHospOther, "1,2") || functions.GEN_INLIST(untrimmedline.rxHospPalliativeProc, "2-3,5,6") || functions.GEN_INLIST(untrimmedline.rxHospSurgOthRegDis, "1-5") || functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "10-90") || functions.GEN_INLIST(untrimmedline.radLocationOfRx, "1-3"))
            return false
        return true

    }

    // ID: NAACCR-00556; TAG: N1119; NAME: Class of Case, Date of 1st Cont, Date of DX (COC)
    public boolean naaccr00556(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dtcmp
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.classOfCase))
            return true
        if (functions.GEN_EMPTY(untrimmedline.dateOf1stContact) || functions.GEN_EMPTY(untrimmedline.dateOfDiagnosis))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOf1stContact, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOf1stContact))
                functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact 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 (functions.GEN_AT(untrimmedline.classOfCase, "303132", 2) != 0) {
                if (dtcmp >= 0)
                    return true
                else
                    return false
            }
            else {
                if (dx_year >= 2021) {
                    if (functions.GEN_AT(untrimmedline.classOfCase, "001314", 2) != 0) {
                        if (dtcmp == 0)
                            return true
                        else
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'If Class of Case = ${untrimmedline.classOfCase}, Date of 1st Contact must = Date of Diagnosis')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00557; TAG: N0366; NAME: Class of Case, Type of Reporting Source (NAACCR)
    public boolean naaccr00557(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.classOfCase) || functions.GEN_EMPTY(untrimmedline.typeOfReportingSource))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "49")) {
            if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            if (!functions.GEN_INLIST(untrimmedline.classOfCase, "38"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7")) {
            if (!functions.GEN_INLIST(untrimmedline.classOfCase, "49"))
                return false
        }
        return true

    }

    // ID: NAACCR-00558; TAG: N1373; NAME: Class of Case,Prim Site,Hist, Beh,DX (COC)
    public boolean naaccr00558(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "00-22"))
            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
        if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
            return false
        if (functions.GEN_INLIST(untrimmedline.primarySite, "530-539,619, 510-519, 529, 210-218", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8077,8148"))
            return false
        if (!(functions.GEN_INLIST(untrimmedline.primarySite, "700-709,710-719,720-729,751-753", "(C\\d\\d\\d)", 2, 3)) && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            return false
        if (functions.GEN_INLIST(untrimmedline.primarySite, "700-709,710-719,720-729,751-753", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1") && dx_year < 2004)
            return false
        return true

    }

    // ID: NAACCR-00559; TAG: N0353; NAME: Class, Date Diag, Date Last Cont, Vit Stat (COC)
    public boolean naaccr00559(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.dateOfDiagnosis))
            return true
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38,49")) {
            if (!functions.GEN_INLIST(untrimmedline.vitalStatus, "0"))
                return false
        }
        if (!functions.GEN_INLIST(untrimmedline.classOfCase, "38"))
            return true
        dtcmp = functions.GEN_DATECMP_IOP(binding, untrimmedline.dateOfLastContact, untrimmedline.dateOfDiagnosis, ((Integer)context.NAACCR_GEN_DT_MIN))
        if (dtcmp != 0)
            return false
        return true
        
        if (dtcmp == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            if (!functions.GEN_VALID_DATE_IOP(binding, untrimmedline.dateOfLastContact))
                functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact 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-00560; TAG: N0121; NAME: Coding System for EOD (SEER EODSYST)
    public boolean naaccr00560(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.codingSystemForEod)) {
            return true
        }
        return functions.GEN_INLIST(untrimmedline.codingSystemForEod, "0-4", "(\\d)")

    }

    // ID: NAACCR-00561; TAG: N1762; NAME: Comorbid/Compl 1, Secondary DX 1, Date DX (COC)
    public boolean naaccr00561(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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 (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.comorbidComplication1) && functions.GEN_EMPTY(untrimmedline.secondaryDiagnosis1))
                return false
        }
        return true

    }

    // ID: NAACCR-00562; TAG: N0747; NAME: Comorbid/Complication 1 - 10 (COC)
    public boolean naaccr00562(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "00000") || functions.GEN_EMPTY(untrimmedline.comorbidComplication1)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication2))
                return functions.GEN_ERROR_MSG(binding, 'If Comorbid/Complication 1=00000 or blank, then subsequent Comorbid/Complication items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication2)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication3))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication3)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication4))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication4)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication5))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication5)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication6))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication6)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication7))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication7)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication8))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication8)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication9))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        if (functions.GEN_EMPTY(untrimmedline.comorbidComplication9)) {
            if (!functions.GEN_EMPTY(untrimmedline.comorbidComplication10))
                return functions.GEN_ERROR_MSG(binding, 'If any Comorbid/Complication items are blank, subsequent items must be blank')
        }
        return true

    }

    // ID: NAACCR-00563; TAG: N0504; NAME: Comorbid/Complication 1, Date DX (COC)
    public boolean naaccr00563(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.comorbidComplication1, "00000") || functions.GEN_EMPTY(untrimmedline.comorbidComplication1))
            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 < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication1, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return functions.GEN_ERROR_MSG(binding, 'Comorbid/Complication 1 and Date of Diagnosis conflict')
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication1, context.NAACCR_ICD9CM, context.NAACCR_ICD9CM_CODE, [:]))
                return functions.GEN_ERROR_MSG(binding, 'Comorbid/Complication 1 and Date of Diagnosis conflict')
        }
        return true

    }

    // ID: NAACCR-00564; TAG: N1480; NAME: Comorbid/Complication 10, Date DX (COC)
    public boolean naaccr00564(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        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.comorbidComplication10))
            return true
        if (dx_year < 2011) {
            if (functions.GEN_INLIST(untrimmedline.comorbidComplication10, "00000,00100-13980,24000-99990", "(\\d\\d\\d\\d\\d)"))
                return true
            else {
                if (functions.GEN_INLIST(untrimmedline.comorbidComplication10, "8700-8799,9300-9499", "(E\\d\\d\\d\\d)", 2, 4))
                    return true
                else {
                    if (functions.GEN_INLIST(untrimmedline.comorbidComplication10, "0720-0739,1000-1590,2220-2310,2540,4400-4589,5041-5049", "(V\\d\\d\\d\\d)", 2, 4))
                        return true
                    else
                        return false
                }
            }
        }
        else {
            if (!functions.GEN_ILOOKUP(untrimmedline.comorbidComplication10, context.NAACCR_ICD9CM, context.NAACCR_ICD9CM_CODE, [:]))
                return false
        }
        
        return true

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy