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

com.imsweb.validation.edits.translated.naaccr.NaaccrTranslatedCompiledRules1.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 NaaccrTranslatedCompiledRules1 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-00001' <= id && id <= 'NAACCR-00292'
    }

    // ID: NAACCR-00001; TAG: N0148; NAME: Abstracted By (COC)
    public boolean naaccr00001(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.abstractedBy))
            return true
        return functions.GEN_MATCH(untrimmedline.abstractedBy, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")

    }

    // ID: NAACCR-00002; TAG: N0201; NAME: Abstracted By (NAACCR)
    public boolean naaccr00002(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.abstractedBy, "([A-Za-z0-9]((\\s)|([A-Za-z0-9]))*)")

    }

    // ID: NAACCR-00003; TAG: N0360; NAME: Abstracted By, Date of Diagnosis (COC)
    public boolean naaccr00003(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.abstractedBy))
                return false
        }
        return true

    }

    // ID: NAACCR-00004; TAG: N0551; NAME: Accession Number, Class of Case, Seq Number (NAACCR)
    public boolean naaccr00004(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dolc_year, dofc_year, dx_year
        char[] ac_yy = new char[5]
        char[] message = new char[70]
        
        if (functions.GEN_INLIST(untrimmedline.overRideAcsnClassSeq, "1")) {
            return true
        }
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        dofc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOf1stContact)
        
        if (dofc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of 1st Contact: %DC')
        dolc_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfLastContact)
        if (dolc_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Last Contact: %DC')
        functions.GEN_STRCPY(message, "OR must be set if Seq Num 00, 01, 60, or 61 added after accession year")
        
        functions.GEN_STRCPY(ac_yy, functions.GEN_SUBSTR(untrimmedline.accessionNumberHosp, 1, 4))
        
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "00,10-14")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00,01,60,61")) {
                if (dx_year < 1996) {
                    if (functions.GEN_VAL(ac_yy) < dx_year) {
                        functions.GEN_SAVE_TEXT(binding, message)
                        return functions.GEN_ERROR_MSG(binding, 'Conflict among Class of Case, Accession Number--Hosp, Sequence Number--Hospital, Date of Diagnosis')
                    }
                }
                else {
                    if (functions.GEN_VAL(ac_yy) != dofc_year) {
                        functions.GEN_SAVE_TEXT(binding, message)
                        return false
                    }
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00,01,60,61")) {
                if ((functions.GEN_VAL(ac_yy) != dofc_year) || (dolc_year != dofc_year)) {
                    functions.GEN_SAVE_TEXT(binding, message)
                    return false
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.classOfCase, "38")) {
            if (!functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00,01,60,61")) {
                if (dolc_year != dofc_year) {
                    functions.GEN_SAVE_TEXT(binding, message)
                    return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-00005; TAG: N0034; NAME: Accession Number--Hosp (COC)
    public boolean naaccr00005(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_MATCH(untrimmedline.accessionNumberHosp, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return false
        if (functions.GEN_INLIST(untrimmedline.accessionNumberHosp, "00000", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)", 5, 5))
            return false
        if ((functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.accessionNumberHosp, 1, 4)) > 1929) && (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.accessionNumberHosp, 1, 4)) <= functions.GEN_DATE_YEAR_IOP(binding, functions.GEN_DT_TODAY())))
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00006; TAG: N0156; NAME: Addr Current--City (SEER)
    public boolean naaccr00006(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentCity))
            return true
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrCurrentCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentCity, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrCurrentCity, idx, 2), "(\\s\\s)"))
                return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
            idx = idx + 1
        }
        return functions.GEN_MATCH(untrimmedline.addrCurrentCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: NAACCR-00007; TAG: N0350; NAME: Addr Current--City (NAACCR)
    public boolean naaccr00007(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int len
        int idx
        
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrCurrentCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentCity, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrCurrentCity, idx, 2), "(\\s\\s)"))
                return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
            idx = idx + 1
        }
        return functions.GEN_MATCH(untrimmedline.addrCurrentCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: NAACCR-00008; TAG: N0342; NAME: Addr Current--City, Date of Diagnosis (COC)
    public boolean naaccr00008(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrCurrentCity))
                return false
        }
        return true

    }

    // ID: NAACCR-00009; TAG: N1684; NAME: Addr Current--Country (SEER)
    public boolean naaccr00009(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.addrCurrentCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00010; TAG: N1667; NAME: Addr Current--Country (NAACCR)
    public boolean naaccr00010(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_LOOKUP(untrimmedline.addrCurrentCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00011; TAG: N1685; NAME: Addr Current--Country, Date of Diagnosis (COC)
    public boolean naaccr00011(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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.addrCurrentCountry))
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Addr Current--Country cannot be ${untrimmedline.addrCurrentCountry} if Date of Diagnosis is greater than 2012')
        
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00012; TAG: N1686; NAME: Addr Current--Country, Date of Diagnosis (NAACCR)
    public boolean naaccr00012(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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.addrCurrentCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrCurrentCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00013; TAG: N1700; NAME: Addr Current--Country, State (NAACCR)
    public boolean naaccr00013(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cntry_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentCountry) || functions.GEN_EMPTY(untrimmedline.addrCurrentState))
            return true
        functions.GEN_STRCPY(cntry_state, untrimmedline.addrCurrentCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.addrCurrentState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00014; TAG: N0150; NAME: Addr Current--No/Street (SEER)
    public boolean naaccr00014(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet)) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.addrCurrentNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrCurrentNoStreet, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: NAACCR-00015; TAG: N0351; NAME: Addr Current--No/Street (NAACCR)
    public boolean naaccr00015(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_MATCH(untrimmedline.addrCurrentNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrCurrentNoStreet, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: NAACCR-00016; TAG: N0362; NAME: Addr Current--No/Street, Date of Diagnosis (COC)
    public boolean naaccr00016(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrCurrentNoStreet))
                return false
        }
        return true

    }

    // ID: NAACCR-00017; TAG: N0336; NAME: Addr Current--Postal Code (SEER)
    public boolean naaccr00017(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode))
            return true
        return functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")

    }

    // ID: NAACCR-00018; TAG: N0170; NAME: Addr Current--Postal Code (NAACCR)
    public boolean naaccr00018(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")

    }

    // ID: NAACCR-00019; TAG: N0352; NAME: Addr Current--Postal Code, Addr Current--State (NAACCR)
    public boolean naaccr00019(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode) || functions.GEN_EMPTY(untrimmedline.addrCurrentState))
            return true
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode) || functions.GEN_EMPTY(untrimmedline.addrCurrentState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "AA,AE,AP"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "US", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "CD", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "ZZ", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "88888, 888888888")) {
            if (!functions.GEN_INLIST(untrimmedline.addrCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999, 999999, 999999999")) {
            if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrCurrentState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "([A-Z]\\d[A-Z]\\d[A-Z]\\d\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.addrCurrentPostalCode, "99999,999999,999999999"))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)") && !functions.GEN_MATCH(untrimmedline.addrCurrentPostalCode, "(\\d\\d\\d\\d\\d\\s\\s\\s\\s)"))
                return false
        }
        if (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.addrCurrentPostalCode, 1, 5)) < 10)
            return false
        return true

    }

    // ID: NAACCR-00020; TAG: N0337; NAME: Addr Current--Postal Code, Date of Diagnosis (COC)
    public boolean naaccr00020(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrCurrentPostalCode))
                return false
        }
        return true

    }

    // ID: NAACCR-00021; TAG: N0338; NAME: Addr Current--State (SEER)
    public boolean naaccr00021(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentState))
            return true
        return functions.GEN_LOOKUP(untrimmedline.addrCurrentState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])

    }

    // ID: NAACCR-00022; TAG: N0197; NAME: Addr Current--State (NAACCR)
    public boolean naaccr00022(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_LOOKUP(untrimmedline.addrCurrentState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])

    }

    // ID: NAACCR-00023; TAG: N0339; NAME: Addr Current--State, Date of Diagnosis (COC)
    public boolean naaccr00023(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrCurrentState))
                return false
        }
        return true

    }

    // ID: NAACCR-00024; TAG: N0538; NAME: Addr Current--Supplementl (SEER)
    public boolean naaccr00024(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentSupplementl))
            return true /* must be left justified */
        if (!functions.GEN_MATCH(untrimmedline.addrCurrentSupplementl, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrCurrentSupplementl))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrCurrentSupplementl, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrCurrentSupplementl, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: NAACCR-00025; TAG: N0037; NAME: Addr at DX--City (COC)
    public boolean naaccr00025(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxCity))
            return true
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrAtDxCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxCity, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrAtDxCity, idx, 2), "(\\s\\s)"))
                return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
            idx = idx + 1
        }
        return functions.GEN_MATCH(untrimmedline.addrAtDxCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: NAACCR-00026; TAG: N0799; NAME: Addr at DX--City (NAACCR)
    public boolean naaccr00026(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int len
        int idx
        
        if (functions.GEN_LOOKUP(functions.GEN_UPPER(untrimmedline.addrAtDxCity), context.NAACCR_CITY_SPC, context.NAACCR_CITY_SPC_CITY, [:]))
            return true
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxCity, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            if (functions.GEN_MATCH(functions.GEN_SUBSTR(untrimmedline.addrAtDxCity, idx, 2), "(\\s\\s)"))
                return functions.GEN_ERROR_MSG(binding, 'More than one consecutive embedded space is not allowed')
            idx = idx + 1
        }
        return functions.GEN_MATCH(untrimmedline.addrAtDxCity, "([A-Za-z]((\\s)|([A-Za-z]))*)")

    }

    // ID: NAACCR-00027; TAG: N0341; NAME: Addr at DX--City, Date of Diagnosis (COC)
    public boolean naaccr00027(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrAtDxCity))
                return false
        }
        return true

    }

    // ID: NAACCR-00028; TAG: N1680; NAME: Addr at DX--Country (COC)
    public boolean naaccr00028(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxCountry))
            return true
        if (!functions.GEN_LOOKUP(untrimmedline.addrAtDxCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00029; TAG: N1666; NAME: Addr at DX--Country (NAACCR)
    public boolean naaccr00029(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_LOOKUP(untrimmedline.addrAtDxCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00030; TAG: N1681; NAME: Addr at DX--Country, Date of Diagnosis (COC)
    public boolean naaccr00030(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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.addrAtDxCountry))
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Addr at DX--Country cannot be ${untrimmedline.addrAtDxCountry} if Date of Diagnosis is greater than 2012')
        
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00031; TAG: N1683; NAME: Addr at DX--Country, Date of Diagnosis (NAACCR)
    public boolean naaccr00031(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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.addrAtDxCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.addrAtDxCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00032; TAG: N1699; NAME: Addr at DX--Country, State (NAACCR)
    public boolean naaccr00032(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] cntry_state = new char[6]
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxCountry) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
            return true
        functions.GEN_STRCPY(cntry_state, untrimmedline.addrAtDxCountry)
        functions.GEN_STRCAT(cntry_state, untrimmedline.addrAtDxState)
        
        if (!functions.GEN_LOOKUP(cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_CNTRY_ST, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00033; TAG: N0149; NAME: Addr at DX--No/Street (SEER)
    public boolean naaccr00033(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet)) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.addrAtDxNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrAtDxNoStreet, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: NAACCR-00034; TAG: N0348; NAME: Addr at DX--No/Street (NAACCR)
    public boolean naaccr00034(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_MATCH(untrimmedline.addrAtDxNoStreet, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxNoStreet, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrAtDxNoStreet, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

    // ID: NAACCR-00035; TAG: N0361; NAME: Addr at DX--No/Street, Date of Diagnosis (COC)
    public boolean naaccr00035(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrAtDxNoStreet))
                return false
        }
        return true

    }

    // ID: NAACCR-00036; TAG: N0123; NAME: Addr at DX--Postal Code (NAACCR)
    public boolean naaccr00036(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "([A-Za-z0-9](([A-Za-z0-9]))*((\\s))*)")

    }

    // ID: NAACCR-00037; TAG: N0349; NAME: Addr at DX--Postal Code, Addr at DX--State (COC)
    public boolean naaccr00037(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxPostalCode) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AA,AE,AP"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "US", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "CD", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "ZZ", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999,999999, 999999999"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "88888, 888888888")) {
            if (!functions.GEN_INLIST(untrimmedline.addrAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999, 999999, 999999999")) {
            if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "XX,YY", "([A-Za-z0-9][A-Za-z0-9])"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT", "([A-Za-z0-9][A-Za-z0-9])")) {
            if (functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "([A-Z]\\d[A-Z]\\d[A-Z]\\d\\s\\s\\s)") || functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999,999999,999999999"))
                return true
            else
                return false
        }
        else {
            if (!functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "(\\d\\d\\d\\d\\d\\d\\d\\d\\d)") && !functions.GEN_MATCH(untrimmedline.addrAtDxPostalCode, "(\\d\\d\\d\\d\\d\\s\\s\\s\\s)"))
                return false
        }
        if (functions.GEN_VAL(functions.GEN_SUBSTR(untrimmedline.addrAtDxPostalCode, 1, 5)) < 10)
            return false
        return true

    }

    // ID: NAACCR-00038; TAG: N0334; NAME: Addr at DX--State (COC)
    public boolean naaccr00038(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxState))
            return true
        return functions.GEN_LOOKUP(untrimmedline.addrAtDxState, context.NAACCR_STATE, context.NAACCR_STATE_CODE, [:])

    }

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

    }

    // ID: NAACCR-00040; TAG: N0335; NAME: Addr at DX--State, Date of Diagnosis (COC)
    public boolean naaccr00040(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 1995) {
            if (functions.GEN_EMPTY(untrimmedline.addrAtDxState))
                return false
        }
        return true

    }

    // ID: NAACCR-00041; TAG: N0909; NAME: Addr at DX--State, Postal Code Range (NAACCR)
    public boolean naaccr00041(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] state = new char[3], st_ziplow = new char[100], ziplow = new char[6], ziphigh = new char[6]
        
        char[] StateZip = new char[20]
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxPostalCode) || functions.GEN_EMPTY(untrimmedline.addrAtDxState))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxPostalCode, "99999, 999999999")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AA,AE,AP,CD,US,XX,YY,ZZ"))
            return true
        if (functions.GEN_INLIST(untrimmedline.addrAtDxState, "AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT")) {
            return true
        }
        functions.GEN_STRCPY(StateZip, untrimmedline.addrAtDxState)
        functions.GEN_STRCAT(StateZip, untrimmedline.addrAtDxPostalCode, 5)
        
        if (functions.GEN_RLOOKUP(StateZip, context.NAACCR_STATEZIP, context.NAACCR_STATEZIP_ST_ZIPLOW, ['STATE':state, 'ZIPLOW':ziplow, 'ZIPHIGH':ziphigh, 'ST_ZIPLOW':st_ziplow])) {
            if (functions.GEN_STRCMP(untrimmedline.addrAtDxState, state) == 0 && functions.GEN_STRCMP(untrimmedline.addrAtDxPostalCode, ziplow, 5) >= 0 && functions.GEN_STRCMP(untrimmedline.addrAtDxPostalCode, ziphigh, 5) <= 0)
                return true
            else
                return true
        }
        
        return true

    }

    // ID: NAACCR-00042; TAG: N0537; NAME: Addr at DX--Supplementl (NPCR)
    public boolean naaccr00042(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxSupplementl)) {
            return true
        }
        if (!functions.GEN_MATCH(untrimmedline.addrAtDxSupplementl, "([^ \\t\\r\\n\\v\\f]((.))*)")) {
            return false
        }
        char[] searchchar = new char[2]
        int len
        int idx
        
        if (functions.GEN_EMPTY(untrimmedline.addrAtDxSupplementl))
            return false
        len = (functions.GEN_STRLEN(functions.GEN_TRIM(untrimmedline.addrAtDxSupplementl, ((Integer)context.NAACCR_GEN_RIGHT))))
        
        idx = 1
        while (idx < len) {
            functions.GEN_STRCPY(searchchar, functions.GEN_SUBSTR(untrimmedline.addrAtDxSupplementl, idx, 1), 1)
            if (!functions.GEN_LOOKUP(searchchar, context.NAACCR_STREET, context.NAACCR_STREET_ONE_CHAR, [:]))
                return false
            idx = idx + 1
        }
        return true

    }

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

    }

    // ID: NAACCR-00044; TAG: N0363; NAME: Age at Diagnosis, Text--Usual Industry (NAACCR)
    public boolean naaccr00044(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int wrk_age, diag_age
        
        int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
        
        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 < 1996)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ageAtDiagnosis)) {
            birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
        
            if (birth_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
                return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
            dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
            birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
            dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
            birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
        
            if ((birth_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
                wrk_age = 999
                return true
            }
            else {
                if ((birth_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)))
                    wrk_age = dx_year - birth_year
                else
                    wrk_age = (int)(((dx_year * 12 + dx_month) - (birth_year * 12 + birth_month)) / 12)
            }
            if (dx_month == birth_month) {
                if ((dx_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) && (birth_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY))) {
                    if (dx_day < birth_day)
                        wrk_age = (wrk_age - 1)
                }
            }
            if (wrk_age == 999)
                return true
        }
        else
            wrk_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        if ((wrk_age > 13) && functions.GEN_EMPTY(untrimmedline.textUsualIndustry))
            return false
        return true

    }

    // ID: NAACCR-00045; TAG: N0364; NAME: Age at Diagnosis, Text--Usual Occupation (NAACCR)
    public boolean naaccr00045(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int wrk_age, diag_age
        
        int dx_year, dx_month, dx_day, birth_year, birth_month, birth_day
        
        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 < 1996)
            return true
        if (functions.GEN_EMPTY(untrimmedline.ageAtDiagnosis)) {
            birth_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfBirth)
        
            if (birth_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
                return functions.GEN_ERROR_TEXT(binding, 'Date of Birth: %DC')
            dx_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfDiagnosis)
            birth_month = functions.GEN_DATE_MONTH_IOP(binding, untrimmedline.dateOfBirth)
            dx_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfDiagnosis)
            birth_day = functions.GEN_DATE_DAY_IOP(binding, untrimmedline.dateOfBirth)
        
            if ((birth_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
                wrk_age = 999
                return true
            }
            else {
                if ((birth_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)) || (dx_month == ((Integer)context.NAACCR_GEN_DT_MONTH_EMPTY)))
                    wrk_age = dx_year - birth_year
                else
                    wrk_age = (int)(((dx_year * 12 + dx_month) - (birth_year * 12 + birth_month)) / 12)
            }
            if (dx_month == birth_month) {
                if ((dx_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY)) && (birth_day != ((Integer)context.NAACCR_GEN_DT_DAY_EMPTY))) {
                    if (dx_day < birth_day)
                        wrk_age = (wrk_age - 1)
                }
            }
            if (wrk_age == 999)
                return true
        }
        else
            wrk_age = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        if ((wrk_age > 13) && functions.GEN_EMPTY(untrimmedline.textUsualOccupation))
            return false
        return true

    }

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

    }

    // ID: NAACCR-00047; TAG: N0473; NAME: Age, Histologic Type, COD, ICDO3 (SEER IF43)
    public boolean naaccr00047(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        if (functions.GEN_VAL(untrimmedline.histologicTypeIcdO3) == 9800 && functions.GEN_VAL(untrimmedline.ageAtDiagnosis) < 30 && functions.GEN_INLIST(untrimmedline.causeOfDeath, "2040,C910"))
            return false
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00050; TAG: N0001; NAME: Age, Primary Site, Morphology ICDO2 (SEER IF15)
    public boolean naaccr00050(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int agetemp
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.morphTypebehavIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year > 2000)
            return true
        if (functions.GEN_INLIST(untrimmedline.overRideAgeSiteMorph, "1,3")) {
            return true
        }
        if (functions.GEN_INLIST(untrimmedline.ageAtDiagnosis, "999"))
            return true
        agetemp = functions.GEN_VAL(untrimmedline.ageAtDiagnosis)
        
        if (agetemp < 15) {
            if ((functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO2, "(\\d\\d\\d\\d2)")) || (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO2, "(9100\\d)")))
                return false
        }
        if (agetemp < 20) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "150-159,170-179,199,209-218,239,240-249,250-259,384,500-509,559,540-549", "(C\\d\\d\\d)", 2, 3) || (functions.GEN_INLIST(untrimmedline.primarySite, "180-189,339,340-349", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "00000-82399,82450-99999")) || (functions.GEN_INLIST(untrimmedline.primarySite, "530-539", "(C\\d\\d\\d)", 2, 3) && functions.GEN_MATCH(untrimmedline.morphTypebehavIcdO2, "(\\d\\d\\d\\d3)")))
                return false
        }
        if (agetemp < 30) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C609") || functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "9732, 9863, 9868, 9890, 9823", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp < 40) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C619") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "8140", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 5) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "690-699", "(C\\d\\d\\d)", 2, 3) && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "9510-9512", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 14) {
            if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "8960", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        if (agetemp > 45) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C589") && functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO2, "9100", "(\\d\\d\\d\\d\\d)", 1, 4))
                return false
        }
        return true

    }

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

    }

    // ID: NAACCR-00052; TAG: N0902; NAME: Ambig Term DX, Date Conclusive DX (SEER IF162)
    public boolean naaccr00052(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx) || (functions.GEN_EMPTY(untrimmedline.dateConclusiveDx) && functions.GEN_EMPTY(untrimmedline.dateConclusiveDxFlag)))
            return true
        if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "0")) {
            if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "11"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "11")) {
            if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "0"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "1")) {
            if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "15"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "15")) {
            if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "1"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "2")) {
            if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "11,15"))
                return false
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "9")) {
            if (functions.GEN_INLIST(untrimmedline.dateConclusiveDxFlag, "10,12"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00053; TAG: N0741; NAME: Ambiguous Terminology DX (SEER)
    public boolean naaccr00053(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
            return true
        return functions.GEN_INLIST(untrimmedline.ambiguousTerminologyDx, "0-2,9")

    }

    // ID: NAACCR-00054; TAG: N1381; NAME: Ambiguous Terminology DX, Date of DX (CCCR)
    public boolean naaccr00054(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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 > 2007) && (dx_year < 2013)) {
            if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
                return false
        }
        if (dx_year < 2008) {
            if (!functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2008, then Ambiguous Terminology DX must be blank')
        }
        return true

    }

    // ID: NAACCR-00055; TAG: N0882; NAME: Ambiguous Terminology DX, Date of DX (SEER IF157)
    public boolean naaccr00055(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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) && (dx_year < 2013)) {
            if (functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
                return false
        }
        if (dx_year < 2007) {
            if (!functions.GEN_EMPTY(untrimmedline.ambiguousTerminologyDx))
                return functions.GEN_ERROR_MSG(binding, 'If year of Date of Diagnosis < 2007, then Ambiguous Terminology DX must be blank')
        }
        return true

    }

    // ID: NAACCR-00056; TAG: N0524; NAME: Archive FIN (COC)
    public boolean naaccr00056(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.archiveFin))
            return true
        if (functions.GEN_INLIST(untrimmedline.archiveFin, "0010,0020, 0006", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)", 1, 4))
            return true
        return false

    }

    // ID: NAACCR-00057; TAG: N0550; NAME: Archive FIN, Date of Diagnosis (COC)
    public boolean naaccr00057(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.archiveFin))
                return false
        }
        return true

    }

    // ID: NAACCR-00058; TAG: N0831; NAME: Autopsy Only, RX (NPCR)
    public boolean naaccr00058(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year, err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR) || dx_year < 2006 || dx_year > 2017)
            return true
        if (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6")) {
            return true
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00,98", "(\\d\\d)")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Prim Site')
            err_flag = 1
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "420,421,423,424,700-729,751-753,760-768,809", "(C\\d\\d\\d)", 2, 3) || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9590-9992", "(\\d\\d\\d\\d)")) {
            if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0,9")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0,9")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
                err_flag = 1
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.rxSummScopeRegLnSur, "0")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Scope Reg LN Sur')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.rxSummSurgOthRegDis, "0")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg Oth Reg/Dis')
                err_flag = 1
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.reasonForNoSurgery, "1,9")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Reason for No Surgery')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummBrm, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--BRM')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummChemo, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Chemo')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummHormone, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Hormone')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummOther, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Other')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummTransplntEndocr, "00")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Transplnt/Endocr')
            err_flag = 1
        }
        if (dx_year < 2018) {
            if (!functions.GEN_INLIST(untrimmedline.radRegionalRxModality, "00")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Rad--Regional RX Modality')
                err_flag = 1
            }
        }
        if (dx_year == 2018) {
            if (!functions.GEN_INLIST(untrimmedline.phase1RadiationTreatmentModality, "00")) {
                functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & Phase I Radiation Treatment Modality')
                err_flag = 1
            }
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSurgRadSeq, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Surg/Rad Seq')
            err_flag = 1
        }
        if (!functions.GEN_INLIST(untrimmedline.rxSummSystemicSurSeq, "0")) {
            functions.GEN_SAVE_TEXT(binding, 'Conflict between Autopsy Only & RX Summ--Systemic/Sur Seq')
            err_flag = 1
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-00059; TAG: N0624; NAME: Behav ICDO2, Date of DX, ICDO2 Conv Flag (SEER IF85)
    public boolean naaccr00059(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
                return false
        }
        if (dx_year > 2000) {
            if (!functions.GEN_EMPTY(untrimmedline.behaviorIcdO2)) {
                if (!functions.GEN_INLIST(untrimmedline.icdO2ConversionFlag, "0,5,6"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00060; TAG: N0626; NAME: Behav ICDO3, Date of DX, ICDO3 Conv Flag (SEER IF87)
    public boolean naaccr00060(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            return true
        if ((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 2000)) {
            if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
                return false
        }
        if (dx_year < 2001) {
            if (!functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3)) {
                if (!functions.GEN_INLIST(untrimmedline.icdO3ConversionFlag, "1,3"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00061; TAG: N0638; NAME: Behavior (73-91) ICD-O-1 (SEER)
    public boolean naaccr00061(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO1))
            return true
        return functions.GEN_INLIST(untrimmedline.behaviorIcdO1, "0-3")

    }

    // ID: NAACCR-00062; TAG: N0331; NAME: Behavior Code ICDO2, Sequence Number--Hosp (COC)
    public boolean naaccr00062(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.behaviorIcdO2))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 2000)) && (functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8931,9393,9538,9950,9960-9962,9980-9984,9989")))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59,99", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2,3"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "60-88", "(\\d\\d)"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00063; TAG: N0653; NAME: Behavior Code ICDO3, Seq Num--Central (SEER IF114)
    public boolean naaccr00063(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 < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,99", "(\\d\\d)")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1"))
                    return true
            }
        }
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
                if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
                    return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "00-59,98,99", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
                return true
            else
                return false
        }
        if (dx_year > 2000) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
                if (functions.GEN_INLIST(untrimmedline.sequenceNumberCentral, "60-88", "(\\d\\d)"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00064; TAG: N0470; NAME: Behavior Code ICDO3, Sequence Number--Hosp (COC)
    public boolean naaccr00064(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) || functions.GEN_EMPTY(untrimmedline.sequenceNumberHospital))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001 && (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8931,9393,9538,9950,9960-9962,9980-9984,9989")))
            return true
        if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59,99", "(\\d\\d)")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
                return true
            else
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
            if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "60-88", "(\\d\\d)"))
                return true
            else
                return false
        }
        if ((dx_year > 2003) && (dx_year != ((Integer)context.NAACCR_GEN_DT_EMPTY))) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
                if (functions.GEN_INLIST(untrimmedline.sequenceNumberHospital, "00-59,99", "(\\d\\d)"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00065; TAG: N0238; NAME: Behavior ICDO2 (COC)
    public boolean naaccr00065(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
            return true
        return functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "0,1,2,3")

    }

    // ID: NAACCR-00066; TAG: N0737; NAME: Behavior ICDO2, Behavior ICDO3 (SEER IF115)
    public boolean naaccr00066(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
                return false
        }
        return true

    }

    // ID: NAACCR-00067; TAG: N0468; NAME: Behavior ICDO2, Date of Diagnosis (NAACCR)
    public boolean naaccr00067(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year < 2001) {
            if (functions.GEN_EMPTY(untrimmedline.behaviorIcdO2))
                return false
        }
        return true

    }

    // ID: NAACCR-00068; TAG: N0492; NAME: Behavior ICDO2, Histology ICDO2 (NAACCR)
    public boolean naaccr00068(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "1")) {
            if (((dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY)) || (dx_year > 2000)) && functions.GEN_INLIST(untrimmedline.histologyIcdO2, "8931,9393,9538,9950,9960-9962,9980-9984,9989"))
                return true
            else
                return false
        }
        return true

    }

    // ID: NAACCR-00069; TAG: N0365; NAME: Behavior ICDO2, Summary Stage 1977 (NAACCR)
    public boolean naaccr00069(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "2")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorIcdO2, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00070; TAG: N0469; NAME: Behavior ICDO3 (COC)
    public boolean naaccr00070(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        return functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,2,3")

    }

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

    }

    // ID: NAACCR-00072; TAG: N0467; NAME: Behavior ICDO3, Date of Diagnosis (NAACCR)
    public boolean naaccr00072(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2000) {
            if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
                return false
        }
        return true

    }

    // ID: NAACCR-00073; TAG: N0654; NAME: Behavior ICDO3, Site, Histology ICDO3 (NAACCR)
    public boolean naaccr00073(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.behaviorCodeIcdO3))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
            if (dx_year > 2003 && functions.GEN_INLIST(untrimmedline.primarySite, "700-729,751-753", "(C\\d\\d\\d)", 2, 3))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "1")) {
            if ((dx_year < 2001) && functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8442,8451,8462,8472,8473"))
                return true
        }
        return false

    }

    // ID: NAACCR-00074; TAG: N0838; NAME: Behavior ICDO3, Summary Stage 1977 (NAACCR)
    public boolean naaccr00074(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage1977))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage1977, "0"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00075; TAG: N0439; NAME: Behavior ICDO3, Summary Stage 2000 (NAACCR)
    public boolean naaccr00075(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.seerSummaryStage2000))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
            if (functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0"))
                return true
            else
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                if (!functions.GEN_INLIST(untrimmedline.seerSummaryStage2000, "0"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00076; TAG: N0002; NAME: Birthplace (SEER POB)
    public boolean naaccr00076(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.birthplace))
            return true
        return functions.GEN_ILOOKUP(untrimmedline.birthplace, context.NAACCR_BPLACE, context.NAACCR_BPLACE_CODE, [:])

    }

    // ID: NAACCR-00077; TAG: N1673; NAME: Birthplace--Geocode, Country, State (NAACCR)
    public boolean naaccr00077(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] bplace_cntry_state = new char[9]
        
        if (functions.GEN_EMPTY(untrimmedline.birthplace) || functions.GEN_EMPTY(untrimmedline.birthplaceCountry) || functions.GEN_EMPTY(untrimmedline.birthplaceState))
            return true
        functions.GEN_STRCPY(bplace_cntry_state, untrimmedline.birthplace)
        functions.GEN_STRCAT(bplace_cntry_state, untrimmedline.birthplaceCountry)
        functions.GEN_STRCAT(bplace_cntry_state, untrimmedline.birthplaceState)
        
        if (!functions.GEN_LOOKUP(bplace_cntry_state, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_GEOCNTRYST, [:]))
            return false
        
        return true

    }

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

    }

    // ID: NAACCR-00079; TAG: N1668; NAME: Birthplace--Country (NAACCR)
    public boolean naaccr00079(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_LOOKUP(untrimmedline.birthplaceCountry, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_COUNTRY, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00080; TAG: N1689; NAME: Birthplace--Country, Date of Diagnosis (COC)
    public boolean naaccr00080(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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 > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.birthplaceCountry))
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Birthplace--Country cannot be ${untrimmedline.birthplaceCountry} if Date of Diagnosis is greater than 2012')
        
        return true

    }

    // ID: NAACCR-00081; TAG: N1690; NAME: Birthplace--Country, Date of Diagnosis (NAACCR)
    public boolean naaccr00081(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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.birthplaceCountry))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.birthplaceCountry, "XNI,XCB,XEN,XSC,XGR,XSL,XUM"))
                return false
            if (functions.GEN_INLIST(untrimmedline.birthplaceCountry, "XNF,XSD,XWF,XSF,XEF,XIF,XET,XAP,XIS"))
                return false
            if (functions.GEN_INLIST(untrimmedline.birthplaceCountry, "XCR,XOR,XSE,XMS,XCH,XML,XMC,XPL"))
                return false
        }
        
        return true

    }

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

    }

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

    }

    // ID: NAACCR-00084; TAG: N1671; NAME: Birthplace--State (NAACCR)
    public boolean naaccr00084(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (!functions.GEN_LOOKUP(untrimmedline.birthplaceState, context.NAACCR_CNTRY_ST, context.NAACCR_CNTRY_ST_STATE, [:]))
            return false
        
        return true

    }

    // ID: NAACCR-00085; TAG: N1692; NAME: Birthplace--State, Date of Diagnosis (COC)
    public boolean naaccr00085(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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 > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.birthplaceState))
                return false
        }
        functions.GEN_ERROR_MSG(binding, 'Birthplace--State cannot be ${untrimmedline.birthplaceState} if Date of Diagnosis is greater than 2012')
        
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.birthplaceState, "NN,MM,PP,XN"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00086; TAG: N1693; NAME: Birthplace--State, Date of Diagnosis (NAACCR)
    public boolean naaccr00086(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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.birthplaceState))
            return true
        if (dx_year > 2012) {
            if (functions.GEN_INLIST(untrimmedline.birthplaceState, "NN,MM,PP,XN"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00087; TAG: N0650; NAME: Bladder, RX Hosp--Surg Prim Site, BRM (COC)
    public boolean naaccr00087(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_INLIST(untrimmedline.primarySite, "670-679", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxHospSurgPrimSite, "16")) {
                if (functions.GEN_INLIST(untrimmedline.rxHospBrm, "01"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00088; TAG: N0646; NAME: Bladder, RX Summ--Surg Prim Site, BRM (COC)
    public boolean naaccr00088(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite) || functions.GEN_EMPTY(untrimmedline.rxSummBrm))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "670-679", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "16")) {
                if (functions.GEN_INLIST(untrimmedline.rxSummBrm, "01"))
                    return true
                else
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00089; TAG: N0853; NAME: COC Coding Sys--Curr, COC Coding Sys--Orig (COC)
    public boolean naaccr00089(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.cocCodingSysCurrent) || functions.GEN_EMPTY(untrimmedline.cocCodingSysOriginal))
            return true
        if (functions.GEN_INLIST(untrimmedline.cocCodingSysCurrent, "99") || functions.GEN_INLIST(untrimmedline.cocCodingSysOriginal, "99"))
            return true
        if (functions.GEN_STRCMP(untrimmedline.cocCodingSysCurrent, untrimmedline.cocCodingSysOriginal) >= 0)
            return true
        else
            return false
        
        return true

    }

    // ID: NAACCR-00090; TAG: N0035; NAME: COC Coding Sys--Current (COC)
    public boolean naaccr00090(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.cocCodingSysCurrent, "09", "(\\d\\d)")

    }

    // ID: NAACCR-00091; TAG: N0548; NAME: COC Coding Sys--Current (NAACCR)
    public boolean naaccr00091(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        return functions.GEN_INLIST(untrimmedline.cocCodingSysCurrent, "00-09,99", "(\\d\\d)")

    }

    // ID: NAACCR-00092; TAG: N0367; NAME: COC Coding Sys--Current, Date of Diagnosis (NAACCR)
    public boolean naaccr00092(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_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 > 2017) {
            if (!functions.GEN_INLIST(untrimmedline.cocCodingSysCurrent, "09"))
                return false
        }
        return true

    }

    // ID: NAACCR-00093; TAG: N0036; NAME: COC Coding Sys--Original (COC)
    public boolean naaccr00093(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        if (functions.GEN_EMPTY(untrimmedline.cocCodingSysOriginal))
            return true
        return functions.GEN_INLIST(untrimmedline.cocCodingSysOriginal, "00-09,99", "(\\d\\d)")

    }

    // ID: NAACCR-00094; TAG: N0861; NAME: COC Coding Sys--Original, Date of DX (NAACCR)
    public boolean naaccr00094(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.cocCodingSysOriginal))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year >= 2003 && dx_year <= 2017) {
            if (functions.GEN_AT(untrimmedline.cocCodingSysOriginal, "08") == 0)
                return false
        }
        if (dx_year >= 2018) {
            if (functions.GEN_AT(untrimmedline.cocCodingSysOriginal, "09") == 0)
                return false
        }
        return true

    }

    // ID: NAACCR-00095; TAG: N0581; NAME: COC Coding Sys--Original, Date of Diagnosis (COC)
    public boolean naaccr00095(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year > 2002) {
            if (functions.GEN_EMPTY(untrimmedline.cocCodingSysOriginal))
                return false
        }
        return true

    }

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

    }

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

    }

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

    }

    // ID: NAACCR-00099; TAG: N0944; NAME: CS Ext, Histol ICDO3, Breast Schema (CS)
    public boolean naaccr00099(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.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, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8530")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "710,715, 725, 730, 750")) {
                functions.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-00100; TAG: N1433; NAME: CS Ext, LN, Mets at DX, SSF 1, Retinoblastoma (CS)
    public boolean naaccr00100(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || 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(untrimmedline.behaviorCodeIcdO3, "0,1,"))
            return true
        if (!functions.GEN_INLIST(t_schema_name, "Retinoblastoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "950")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "300-810,999") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-800") && !functions.GEN_INLIST(untrimmedline.csMetsAtDx, "10-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
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "950")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "110-800") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-800") && !functions.GEN_INLIST(untrimmedline.csMetsAtDx, "10-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-00101; TAG: N1432; NAME: CS Ext, LN, Mets at DX, SSF 3, Prostate (CS)
    public boolean naaccr00101(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || 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(untrimmedline.behaviorCodeIcdO3, "0,1,"))
            return true
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "950")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,200-750,990") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-800") && !functions.GEN_INLIST(untrimmedline.csMetsAtDx, "11-60")) {
                functions.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, "950")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "000-750") && !functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-800") && !functions.GEN_INLIST(untrimmedline.csMetsAtDx, "11-60")) {
                functions.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-00102; TAG: N1744; NAME: CS Ext, Surg, TS/Ext Eval, Prostate (CS)
    public boolean naaccr00102(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 < 2012)
            return true
        if (functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            return true
        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, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-150")) {
            if (functions.GEN_INLIST(untrimmedline.rxSummSurgPrimSite, "00-29")) {
                if (!functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "1,3")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
        }
        return true

    }

    // ID: NAACCR-00103; TAG: N1707; NAME: CS Ext,TS/Ext Eval, SSF 1, MelanomaConjunc (CS)
    public boolean naaccr00103(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || 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, "MelanomaConjunctiva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "300,310,315,320,330,335,445,450,470,475,480,485,490,500") && functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,3,6,8")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000,998"))
                return functions.GEN_ERROR_MSG(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Extension, CS Tumor Size/Ext Eval, CS Site-Specific Factor 1')
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "325,495")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2,3,6,8"))
                return functions.GEN_ERROR_MSG(binding, 'Given combination of codes will fail to derive AJCC 7 stage: CS Extension, CS Tumor Size/Ext Eval')
        }
        return true

    }

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

    }

    // ID: NAACCR-00105; TAG: N1024; NAME: CS Extension, Brain Schema (CS)
    public boolean naaccr00105(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.csExtension))
            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"))
            return true
        if (functions.GEN_INLIST(untrimmedline.primarySite, "711-715", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "110,120,200,510")) {
                functions.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.primarySite, "716-717", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "100,500")) {
                functions.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-00106; TAG: N0683; NAME: CS Extension, CS Lymph Nodes, CS Mets at DX (CS)
    public boolean naaccr00106(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension) || functions.GEN_EMPTY(untrimmedline.csLymphNodes) || 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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (!functions.GEN_INLIST(t_schema_name, "Prostate,Retinoblastoma")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "950")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "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(t_schema_name, "Breast")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,050") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                    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
        }
        if (functions.GEN_INLIST(t_schema_name, "IntracranialGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000,988") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                    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
        }
        if (functions.GEN_INLIST(t_schema_name, "Bladder")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "010,030,060")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                    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
        }
        if (functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                    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
        }
        if (functions.GEN_INLIST(t_schema_name, "Urethra")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060,070,080")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                    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
        }
        if (functions.GEN_INLIST(t_schema_name, "UrinaryOther")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                    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
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "000") && functions.GEN_INLIST(untrimmedline.csMetsAtDx, "00"))
                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-00107; TAG: N1173; NAME: CS Extension, CS Tumor Size, Breast Schema (CS)
    public boolean naaccr00107(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.csExtension) || 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, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csTumorSize, "997")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "050,070")) {
                functions.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.csTumorSize, "996")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "400-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.csExtension, "170")) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "990,991,992")) {
                functions.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.csExtension, "180")) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "995")) {
                functions.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-00108; TAG: N1867; NAME: CS Extension, CS Tumor Size, MycosisFungoides (CS)
    public boolean naaccr00108(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csTumorSize))
            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, "MycosisFungoides"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "110,120,130,150,210,220,230,300")) {
            if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "000,999"))
                return false
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "600")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "990,991"))
                    return false
            }
        }
        return true

    }

    // ID: NAACCR-00109; TAG: N0698; NAME: CS Extension, CS Tumor Size, Site, Hist ICDO3 (CS)
    public boolean naaccr00109(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.csExtension) || 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, "KaposiSarcoma,MelanomaSkin,Conjunctiva") && !functions.GEN_INLIST(t_schema_name, "MelanomaConjunctiva,MelanomaChoroid,MelanomaIris") && !functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,LymphomaOcularAdnexa,Prostate")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "950")) {
                if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "950") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "950")) {
                if (!functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize}), CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3})')
                }
            }
        }
        if (!functions.GEN_ILOOKUP((t_schema_name), context.NAACCR_MEL_HN, context.NAACCR_MEL_HN_SCHEMA, [:]) && !functions.GEN_INLIST(t_schema_name, "IllDefinedOther") && !functions.GEN_INLIST(t_schema_name, "MycosisFungoides")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSize, "000")) {
                if (!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 functions.GEN_ERROR_MSG(binding, 'Conflict among schema, CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "AdrenalGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "200,250")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Anus")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "310,320,330")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Bone")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "310,350")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Breast")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "110,130,140,170,180")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "CarcinoidAppendix")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "320,330,335")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "350,360,370,380")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "GISTStomach")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "340,390,395,398")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Hypopharynx")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "305")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "HeartMediastinum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "350,373")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "KidneyParenchyma")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "310,320,330,340,350,360")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "LacrimalGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "610,620,630")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Lung")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "115,120,125")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellPenis")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "330,560,570")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "310,320,330")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "600,610,620")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MerkelCellVulva")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "450,460,470")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "NetAmpulla")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "310,430")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "NETSmallIntestine,NETStomach")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "170")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Orbit")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "200,300")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "ParotidGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "305,310")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "PharyngealTonsil")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "330,350")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Scrotum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "310")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Skin")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "510")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "SoftTissue")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "302,312,322")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Thyroid")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "405,410,415,420")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        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, "PalateHard,TongueAnterior")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "405,410,415")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "PalateSoft,TongueBase")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "405,410")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "GISTAppendix,GISTColon,GISTEsophagus,GISTRectum,GISTSmallIntestine")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "170,210,250,270")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "NETColon,NETRectum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "170,180,190")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "PancreasBodyTail,PancreasHead,PancreasOther")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "150,200")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Peritoneum,Retroperitoneum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "350,375")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Oropharynx,SalivaryGlandOther,SubmandibularGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "305,310")) {
                if (functions.GEN_INLIST(untrimmedline.csTumorSize, "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, 'Conflict among schema, "stated as" CS Extension (${untrimmedline.csExtension}), CS Tumor Size (${untrimmedline.csTumorSize})')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00110; TAG: N0760; NAME: CS Extension, Hematopoietic (CS)
    public boolean naaccr00110(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.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        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, "HemeRetic"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100,999")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9740, 9750, 9751, 9755-9758, 9930")) {
                functions.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-00111; TAG: N1571; NAME: CS Extension, Hist, Grade, Esophagus Schema (CS)
    public boolean naaccr00111(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.csExtension) || functions.GEN_EMPTY(untrimmedline.grade))
            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"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8576,8940-8950,8980-8981")) {
                if (!functions.GEN_INLIST(untrimmedline.grade, "1,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
                }
            }
        }
        return true

    }

    // ID: NAACCR-00112; TAG: N1572; NAME: CS Extension, Hist, Grade, EsophagusGEJunction (CS)
    public boolean naaccr00112(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.csExtension) || functions.GEN_EMPTY(untrimmedline.grade))
            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, "EsophagusGEJunction"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8046, 8051-8131, 8148-8152, 8154-8157, 8170-8175") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8230-8231, 8243-8245, 8247-8248, 8508-8513, 8560-8570, 8575, 8950, 8980-8981")) {
                if (!functions.GEN_INLIST(untrimmedline.grade, "1,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
                }
            }
        }
        return true

    }

    // ID: NAACCR-00113; TAG: N1715; NAME: CS Extension, Histology, Grade, Thyroid (CS)
    public boolean naaccr00113(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.grade) || 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, "Thyroid"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if ((functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8000-8019,8022-8029,8033,8074,8153,8240,8300,8392,8413") || functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8525,8576,8490,8950,8980,8981")) && (functions.GEN_INLIST(untrimmedline.grade, "4"))) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "405,410,415,420,490"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8020,8021,8030,8031,8032")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "405,410,415,420,490"))
                return false
        }
        
        return true

    }

    // ID: NAACCR-00114; TAG: N0710; NAME: CS Extension, KidneyRenalPelvis Schema (CS)
    public boolean naaccr00114(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.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, "KidneyRenalPelvis"))
            return true /* Ureter cnnont have ext of 600 or 665 or 670 */
        if (functions.GEN_INLIST(untrimmedline.primarySite, "669", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "600,665,670")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'KidneyRenalPelvis schema: CS Extension (${untrimmedline.csExtension}) allowed only for C659 (Renal Pelvis)')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "659", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "685,690,695")) {
                functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return functions.GEN_ERROR_MSG(binding, 'KidneyRenalPelvis schema: CS Extension (${untrimmedline.csExtension}) allowed only for C669 (Ureter)')
            }
        }
        return true

    }

    // ID: NAACCR-00115; TAG: N0923; NAME: CS Extension, Lymphoma Schema (CS)
    public boolean naaccr00115(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.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        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, "Lymphoma"))
            return true
        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "770-775,779,024,090-099,111,142,172,181,379", "(C\\d\\d\\d)", 2, 3)) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "110")) {
            if (functions.GEN_INLIST(untrimmedline.primarySite, "770-775,779,379,422", "(C\\d\\d\\d)", 2, 3)) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "120")) {
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "422", "(C\\d\\d\\d)", 2, 3)) {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "778", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_VAL(untrimmedline.csExtension) >= 200)
                return true
            else {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "422", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "120,220,230,320,330,800,999"))
                return true
            else {
                functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                return false
            }
        }
        
        return true

    }

    // ID: NAACCR-00116; TAG: N0955; NAME: CS Extension, Morphology, Bladder ICDO3 (CS)
    public boolean naaccr00116(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.csExtension))
            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.csExtension, "100")) {
            if (functions.GEN_INLIST(untrimmedline.morphTypebehavIcdO3, "81302")) {
                functions.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.morphTypebehavIcdO3, "81302")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "100")) {
                functions.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-00117; TAG: N0963; NAME: CS Extension, Mycosis Fungoides Schema (CS)
    public boolean naaccr00117(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.csExtension))
            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.primarySite, "440-448", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "300")) {
                functions.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-00118; TAG: N1377; NAME: CS Extension, MyelomaPlasmaCellDisorder (CS)
    public boolean naaccr00118(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.csExtension))
            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.csExtension, "100,400")) {
            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
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "110,200,500")) {
            if (!functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "9731")) {
                functions.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.csExtension, "300")) {
            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.csExtension, "810,820")) {
            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
            }
        }
        return true

    }

    // ID: NAACCR-00119; TAG: N0685; NAME: CS Extension, Primary Site, Behavior ICDO3 (CS)
    public boolean naaccr00119(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        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(t_schema_name, "Prostate")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "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(t_schema_name, "Stomach,SmallIntestine,GISTStomach,EsophagusGEJunction") || functions.GEN_INLIST(t_schema_name, "GISTSmallIntestine,NETStomach,NETSmallIntestine")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum,GISTColon,GISTRectum,NETColon,NETRectum")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum,GISTColon,GISTRectum,NETColon,NETRectum")) {
            if (functions.GEN_INLIST(untrimmedline.histologicTypeIcdO3, "8210,8261,8263") && functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "050"))
                    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, 'Conflict among schema, Histologic Type ICD-O-3 (${untrimmedline.histologicTypeIcdO3}), Behavior Code ICD-O-3 (${untrimmedline.behaviorCodeIcdO3}), CS Extension (${untrimmedline.csExtension})')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Breast")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "000,050,070"))
                    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, "Cervix")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "010")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Penis")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050")) {
                if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
                    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, "Brain,CNSOther,IntracranialGland")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "050"))
                    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, "EndocrineOther") && (functions.GEN_INLIST(untrimmedline.primarySite, "754,755", "(C\\d\\d\\d)", 2, 3))) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "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
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "KidneyRenalPelvis,UrinaryOther")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060"))
                    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, "KidneyRenalPelvis,UrinaryOther")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Urethra")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060,070,080"))
                    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, "Urethra")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "050,060,070,080")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Bladder")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "010,030,060,100"))
                    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, "Bladder")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "010,030,060")) {
                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
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MelanomaConjunctiva")) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "005")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3")) {
                    functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                    functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                    functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                    return false
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "100,120")) {
                    if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2,3")) {
                        functions.GEN_STRCPY(t_schema_msg, "Schema: ")
                        functions.GEN_STRCAT(t_schema_msg, t_schema_name)
                        functions.GEN_SAVE_TEXT(binding, t_schema_msg)
                        return false
                    }
                    else
                        return true
                }
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100-999")) {
            if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "3"))
                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-00120; TAG: N1708; NAME: CS Extension, SSF 1, Conjunctiva Schema (CS)
    public boolean naaccr00120(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || 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, "Conjunctiva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "110,120,140,150,350")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00121; TAG: N1868; NAME: CS Extension, SSF 1, Head and Neck Schemas (CS)
    public boolean naaccr00121(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "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
            }
        }
        return true

    }

    // ID: NAACCR-00122; TAG: N1536; NAME: CS Extension, SSF 1, Lung Schema (CS)
    public boolean naaccr00122(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || 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, "Lung"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000,950,980")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "010,020,030,040")) {
                functions.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-00123; TAG: N1778; NAME: CS Extension, SSF 1, MelanomaConjunctiva (CS)
    public boolean naaccr00123(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) || 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, "MelanomaConjunctiva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "300-500")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00124; TAG: N0694; NAME: CS Extension, SSF 1, Thyroid Schema (CS)
    public boolean naaccr00124(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.csExtension))
            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, "Thyroid"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "100")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "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 false
            }
            else
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "200")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "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 false
            }
        }
        return true

    }

    // ID: NAACCR-00125; TAG: N1869; NAME: CS Extension, SSF 11, MerkelCellVulva Schema (CS)
    public boolean naaccr00125(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000,998,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00126; TAG: N1870; NAME: CS Extension, SSF 11, Vulva Schema (CS)
    public boolean naaccr00126(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Vulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "000,998,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00127; TAG: N1871; NAME: CS Extension, SSF 16, MerkelCell Schemas (CS)
    public boolean naaccr00127(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000,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-00128; TAG: N1872; NAME: CS Extension, SSF 16, Scrotum Schema (CS)
    public boolean naaccr00128(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Scrotum"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00129; TAG: N1873; NAME: CS Extension, SSF 16, Skin Schema (CS)
    public boolean naaccr00129(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Skin"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00130; TAG: N1874; NAME: CS Extension, SSF 17, MerkelCell Schemas (CS)
    public boolean naaccr00130(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "010,040,070")) {
                functions.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-00131; TAG: N1875; NAME: CS Extension, SSF 17, Penis Schema (CS)
    public boolean naaccr00131(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Penis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00132; TAG: N1876; NAME: CS Extension, SSF 18, MerkelCell Schemas (CS)
    public boolean naaccr00132(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "MerkelCellPenis,MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "000,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 false
            }
        }
        return true

    }

    // ID: NAACCR-00133; TAG: N1877; NAME: CS Extension, SSF 2, Bladder Schema (CS)
    public boolean naaccr00133(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Bladder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "010,030,060")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00134; TAG: N1698; NAME: CS Extension, SSF 2, KidneyRenalPelvis (CS)
    public boolean naaccr00134(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.csExtension))
            return true
        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.csExtension, "600") && functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "3,6")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000,999"))
                return false
        }
        if (functions.GEN_INLIST(untrimmedline.primarySite, "659", "(C\\d\\d\\d)", 2, 3)) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "001-980,991")) {
                if (functions.GEN_INLIST(untrimmedline.csExtension, "050-400,610,950,999"))
                    return functions.GEN_ERROR_MSG(binding, 'If CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, CS Extension must not = ${untrimmedline.csExtension}')
            }
        }
        return true

    }

    // ID: NAACCR-00135; TAG: N1745; NAME: CS Extension, SSF 2, Lung Schema (CS)
    public boolean naaccr00135(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || 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.csExtension, "000-410")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000,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
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "010,020,040")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "420-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 functions.GEN_ERROR_MSG(binding, 'Lung schema: If CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, CS Extension must not = ${untrimmedline.csExtension}')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "030")) {
            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 functions.GEN_ERROR_MSG(binding, 'Lung schema: If CS Site-Specific Factor 2 = ${untrimmedline.csSiteSpecificFactor2}, CS Extension must not = ${untrimmedline.csExtension}')
            }
        }
        return true

    }

    // ID: NAACCR-00136; TAG: N1709; NAME: CS Extension, SSF 2, MelanomaChoroid (CS)
    public boolean naaccr00136(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || 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, "MelanomaChoroid"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "150,160,170,180")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00137; TAG: N1710; NAME: CS Extension, SSF 2, MelanomaCiliaryBody (CS)
    public boolean naaccr00137(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || 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, "MelanomaCiliaryBody"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "160,180")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00138; TAG: N1878; NAME: CS Extension, SSF 2, Vagina Schema (CS)
    public boolean naaccr00138(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "000,998,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00139; TAG: N1064; NAME: CS Extension, SSF 24, Breast Schema (CS)
    public boolean naaccr00139(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor24, "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.histologicTypeIcdO3, "8540,8541,8543")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor24, "010,020", "(\\d\\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 functions.GEN_ERROR_MSG(binding, 'Breast schema: If Histologic Type ICD-O-3 = ${untrimmedline.histologicTypeIcdO3}, CS Site-Specific Factor24 must = 010 or 020')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csExtension, "050,070")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor24, "010,020", "(\\d\\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 functions.GEN_ERROR_MSG(binding, 'Breast schema: If CS Extension = ${untrimmedline.csExtension}, CS Site-Specific Factor24 must = 010 or 020')
            }
        }
        return true

    }

    // ID: NAACCR-00140; TAG: N1434; NAME: CS Extension, SSF 3, Behavior, Prostate (CS)
    public boolean naaccr00140(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension))
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        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,"))
            return true
        if (!functions.GEN_INLIST(t_schema_name, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000") && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "200-750,985")) {
            if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "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
            }
        }
        else {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "100-750") && functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000")) {
                if (!functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "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
                }
            }
        }
        return true

    }

    // ID: NAACCR-00141; TAG: N1879; NAME: CS Extension, SSF 3, Bladder Schema (CS)
    public boolean naaccr00141(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Bladder"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "010,030,060")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00142; TAG: N1880; NAME: CS Extension, SSF 3, Breast Schema (CS)
    public boolean naaccr00142(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Breast"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,098,099"))
                return false
        }
        return true

    }

    // ID: NAACCR-00143; TAG: N1881; NAME: CS Extension, SSF 3, CorpusCarcinoma Schema (CS)
    public boolean naaccr00143(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "CorpusCarcinoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000,098,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00144; TAG: N1882; NAME: CS Extension, SSF 3, Head and Neck Schemas (CS)
    public boolean naaccr00144(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "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
            }
        }
        return true

    }

    // ID: NAACCR-00145; TAG: N1711; NAME: CS Extension, SSF 3, MelanomaChoroid (CS)
    public boolean naaccr00145(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.csExtension))
            return true
        if (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, "MelanomaChoroid"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "150,160,170,180")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00146; TAG: N1712; NAME: CS Extension, SSF 3, MelanomaCiliaryBody (CS)
    public boolean naaccr00146(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.csExtension))
            return true
        if (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, "MelanomaCiliaryBody"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "160,180")) {
            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "000"))
                return false
        }
        return true

    }

    // ID: NAACCR-00147; TAG: N1883; NAME: CS Extension, SSF 4, FallopianTube Schema (CS)
    public boolean naaccr00147(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "FallopianTube"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000,098,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00148; TAG: N1884; NAME: CS Extension, SSF 4, Head and Neck Schemas (CS)
    public boolean naaccr00148(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "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
            }
        }
        return true

    }

    // ID: NAACCR-00149; TAG: N1885; NAME: CS Extension, SSF 4, Vagina Schema (CS)
    public boolean naaccr00149(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "000,998,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00150; TAG: N1886; NAME: CS Extension, SSF 5, CorpusCarcinoma Schema (CS)
    public boolean naaccr00150(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "CorpusCarcinoma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000,098,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00151; TAG: N1887; NAME: CS Extension, SSF 5, Head and Neck Schemas (CS)
    public boolean naaccr00151(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "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
            }
        }
        return true

    }

    // ID: NAACCR-00152; TAG: N1888; NAME: CS Extension, SSF 5, Testis Schema (CS)
    public boolean naaccr00152(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Testis"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00153; TAG: N1889; NAME: CS Extension, SSF 6, FallopianTube Schema (CS)
    public boolean naaccr00153(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "FallopianTube"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000,098,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00154; TAG: N1890; NAME: CS Extension, SSF 6, Head and Neck Schemas (CS)
    public boolean naaccr00154(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "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
            }
        }
        return true

    }

    // ID: NAACCR-00155; TAG: N1891; NAME: CS Extension, SSF 6, Vagina Schema (CS)
    public boolean naaccr00155(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "Vagina"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "000,998,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00156; TAG: N1892; NAME: CS Extension, SSF 8, KidneyParenchyma (CS)
    public boolean naaccr00156(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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, "KidneyParenchyma"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "000,999"))
                return false
        }
        return true

    }

    // ID: NAACCR-00157; TAG: N1866; NAME: CS Extension, SSF 9, Head and Neck Schemas (CS)
    public boolean naaccr00157(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.csExtension) || functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) || functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1"))
            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_ILOOKUP((t_schema_name), context.NAACCR_SCHEM_HN, context.NAACCR_SCHEM_HN_SCHEMA, [:]))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "000,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-00158; TAG: N1116; NAME: CS Extension, Schema (CS)
    public boolean naaccr00158(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        char[] CS_code = new char[4]
        int t_schema_number, t_max_schemas, t_result
        
        if (functions.GEN_EMPTY(untrimmedline.csExtension) || functions.GEN_EMPTY(untrimmedline.primarySite) || functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        functions.GEN_STRCPY(CS_code, untrimmedline.csExtension)
        
        t_result = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_code_is_valid", t_schema_number, 2, 1, CS_code)
        
        if (t_result <= 0) {
            functions.GEN_STRCPY(t_schema_msg, "Schema: ")
            functions.GEN_STRCAT(t_schema_msg, t_schema_name)
            functions.GEN_SAVE_TEXT(binding, t_schema_msg)
            return false
        }
        
        return true

    }

    // ID: NAACCR-00159; TAG: N0946; NAME: CS Extension, Surgery, Prostate Schema (CS)
    public boolean naaccr00159(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.csExtension))
            return true
        if (functions.GEN_EMPTY(untrimmedline.rxSummSurgPrimSite))
            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 functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            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.csExtension, "130,140")) {
            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
            }
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (functions.GEN_INLIST(untrimmedline.csExtension, "100")) {
                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
                }
            }
        }
        return true

    }

    // ID: NAACCR-00160; TAG: N0950; NAME: CS Extension, TS/Ext Eval, Prostate Schema (CS)
    public boolean naaccr00160(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.csExtension) || 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, "Prostate"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "130,140")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "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
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "2")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "410-700")) {
                functions.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, "8")) {
            if (!functions.GEN_INLIST(untrimmedline.csExtension, "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-00161; TAG: N1713; NAME: CS Extension, Tumor Size, Lung Schema (CS)
    public boolean naaccr00161(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.csExtension) || 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, "Lung"))
            return true
        if (functions.GEN_INLIST(untrimmedline.csExtension, "000")) {
            if (functions.GEN_INLIST(untrimmedline.csTumorSize, "997,998"))
                return false
        }
        return true

    }

    // ID: NAACCR-00162; TAG: N1389; NAME: CS Items - CCCR Required - Non-SSF (CS)
    public boolean naaccr00162(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year > 2017)
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Regional Nodes Examined cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Regional Nodes Positive cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Tumor Size cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Extension cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Tumor Size/Ext Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Lymph Nodes cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Lymph Nodes Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Version Input Original cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Version Input Current cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Site-Specific Factor25 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Bone cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Brain cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Liver cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Lung cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Lymphovascular Invasion cannot be blank')
                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-00163; TAG: N1483; NAME: CS Items - CCCR Required - SSF 1 (CS)
    public boolean naaccr00163(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF1_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 1 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF1_CCCR':SSF1_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF1_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2014)) {
            if (functions.GEN_INLIST(t_schema_name, "Bladder,KidneyRenalPelvis,PeritoneumFemaleGen,Urethra")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                    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 DX Year > 2014, CS Site-Specific Factor 1 must not be 988')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Bladder,KidneyRenalPelvis,PeritoneumFemaleGen,Urethra")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 1 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Esophagus,HeartMediastinum,Lung,Peritoneum,Retroperitoneum") || functions.GEN_INLIST(t_schema_name, "SkinEyelid,SoftTissue")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00164; TAG: N1492; NAME: CS Items - CCCR Required - SSF 10 (CS)
    public boolean naaccr00164(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF10_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor10 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF10_CCCR':SSF10_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF10_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor10 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00165; TAG: N1493; NAME: CS Items - CCCR Required - SSF 11 (CS)
    public boolean naaccr00165(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF11_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor11 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF11_CCCR':SSF11_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF11_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2014)) {
            if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                    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 DX Year > 2014, CS Site-Specific Factor11 must not be 988')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor11 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00166; TAG: N1494; NAME: CS Items - CCCR Required - SSF 12 (CS)
    public boolean naaccr00166(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF12_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor12 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF12_CCCR':SSF12_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF12_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2014)) {
            if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                    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 DX Year > 2014, CS Site-Specific Factor12 must not be 988')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor12 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00167; TAG: N1495; NAME: CS Items - CCCR Required - SSF 13 (CS)
    public boolean naaccr00167(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF13_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor13 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF13_CCCR':SSF13_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF13_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2014)) {
            if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                    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 DX Year > 2014, CS Site-Specific Factor13 must not be 988')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor13 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00168; TAG: N1496; NAME: CS Items - CCCR Required - SSF 14 (CS)
    public boolean naaccr00168(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF14_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor14 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF14_CCCR':SSF14_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF14_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor14 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00169; TAG: N1497; NAME: CS Items - CCCR Required - SSF 15 (CS)
    public boolean naaccr00169(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF15_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor15 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF15_CCCR':SSF15_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF15_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor15 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00170; TAG: N1498; NAME: CS Items - CCCR Required - SSF 16 (CS)
    public boolean naaccr00170(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF16_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor16 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF16_CCCR':SSF16_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF16_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor16 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00171; TAG: N1499; NAME: CS Items - CCCR Required - SSF 17 (CS)
    public boolean naaccr00171(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF17_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor17 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF17_CCCR':SSF17_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF17_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor17 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00172; TAG: N1462; NAME: CS Items - CCCR Required - SSF 18 (CS)
    public boolean naaccr00172(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor18)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor18 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00173; TAG: N1463; NAME: CS Items - CCCR Required - SSF 19 (CS)
    public boolean naaccr00173(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor19)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00174; TAG: N1484; NAME: CS Items - CCCR Required - SSF 2 (CS)
    public boolean naaccr00174(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF2_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 2 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF2_CCCR':SSF2_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF2_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 2 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva,SmallIntestine")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00175; TAG: N1464; NAME: CS Items - CCCR Required - SSF 20 (CS)
    public boolean naaccr00175(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor20)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00176; TAG: N1465; NAME: CS Items - CCCR Required - SSF 21 (CS)
    public boolean naaccr00176(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor21)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor21 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00177; TAG: N1466; NAME: CS Items - CCCR Required - SSF 22 (CS)
    public boolean naaccr00177(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor22)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor22 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00178; TAG: N1467; NAME: CS Items - CCCR Required - SSF 23 (CS)
    public boolean naaccr00178(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor23)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor23 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00179; TAG: N1468; NAME: CS Items - CCCR Required - SSF 24 (CS)
    public boolean naaccr00179(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor24)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00180; TAG: N1485; NAME: CS Items - CCCR Required - SSF 3 (CS)
    public boolean naaccr00180(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF3_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(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, 'For DX Year > 2003, CS Site-Specific Factor 3 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF3_CCCR':SSF3_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF3_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2014)) {
            if (functions.GEN_INLIST(t_schema_name, "Bone")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                    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 DX Year > 2014, CS Site-Specific Factor 3 must not be 988')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Bone")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 3 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00181; TAG: N1486; NAME: CS Items - CCCR Required - SSF 4 (CS)
    public boolean naaccr00181(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF4_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 4 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF4_CCCR':SSF4_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF4_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 4 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00182; TAG: N1487; NAME: CS Items - CCCR Required - SSF 5 (CS)
    public boolean naaccr00182(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF5_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 5 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF5_CCCR':SSF5_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF5_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 5 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00183; TAG: N1488; NAME: CS Items - CCCR Required - SSF 6 (CS)
    public boolean naaccr00183(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF6_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 6 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF6_CCCR':SSF6_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF6_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 6 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTPeritoneum,GISTSmallIntestine") || functions.GEN_INLIST(t_schema_name, "GISTStomach,Rectum,SkinEyelid")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00184; TAG: N1489; NAME: CS Items - CCCR Required - SSF 7 (CS)
    public boolean naaccr00184(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF7_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 7 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF7_CCCR':SSF7_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF7_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2014)) {
            if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                    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 DX Year > 2014, CS Site-Specific Factor 7 must not be 988')
                }
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "Colon,Rectum")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 7 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00185; TAG: N1490; NAME: CS Items - CCCR Required - SSF 8 (CS)
    public boolean naaccr00185(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF8_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 8 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF8_CCCR':SSF8_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF8_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 8 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00186; TAG: N1491; NAME: CS Items - CCCR Required - SSF 9 (CS)
    public boolean naaccr00186(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF9_CCCR = new char[2]
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 9 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF9_CCCR':SSF9_CCCR])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF9_CCCR, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
                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 DX Year > 2009 OR CS Version Input Original of 020302 or higher, CS Site-Specific Factor 9 must not be 988')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00187; TAG: N0691; NAME: CS Items - COC Required - Non-SSF (CS)
    public boolean naaccr00187(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year >= 2016)
            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 (dx_year > 2003) {
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Regional Nodes Examined cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, Regional Nodes Positive cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Tumor Size cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Extension cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Tumor Size/Ext Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Lymph Nodes cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Lymph Nodes Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Mets at DX cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Mets Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Input Original cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Input Current cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Site-Specific Factor25 cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2009) {
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Bone cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Brain cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Liver cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, CS Mets at DX-Lung cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009, Lymphovascular Invasion cannot be blank')
                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-00188; TAG: N1812; NAME: CS Items - COC Required - SSF 1 (CS)
    public boolean naaccr00188(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF1_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 1 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF1_COC':SSF1_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF1_COC, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20001)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,Cervix,Conjunctiva,CorpusAdenosarcoma") || functions.GEN_INLIST(t_schema_name, "CorpusCarcinoma,CorpusSarcoma,Esophagus,FallopianTube") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,HemeRetic,KidneyParenchyma,KidneyRenalPelvis") || functions.GEN_INLIST(t_schema_name, "Lung,MerkelCellPenis,MerkelCellScrotum    ,MerkelCellSkin,MerkelCellVulva") || functions.GEN_INLIST(t_schema_name, "Peritoneum,PeritoneumFemaleGen,Retroperitoneum,Scrotum") || functions.GEN_INLIST(t_schema_name, "Skin,SmallIntestine,SoftTissue,Urethra,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must be 988 for this schema')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Stomach,EsophagusGEJunction,NETStomach"))
                        return true
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                            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 DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,Cervix,Conjunctiva,CorpusAdenosarcoma") || functions.GEN_INLIST(t_schema_name, "CorpusCarcinoma,CorpusSarcoma,Esophagus,FallopianTube") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,HemeRetic,KidneyParenchyma,KidneyRenalPelvis") || functions.GEN_INLIST(t_schema_name, "Lung,MerkelCellPenis,MerkelCellScrotum    ,MerkelCellSkin,MerkelCellVulva") || functions.GEN_INLIST(t_schema_name, "Peritoneum,PeritoneumFemaleGen,Retroperitoneum,Scrotum") || functions.GEN_INLIST(t_schema_name, "Skin,SmallIntestine,SoftTissue,Urethra,Vagina") || functions.GEN_INLIST(t_schema_name, "Stomach,EsophagusGEJunction,NETStomach"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00189; TAG: N1813; NAME: CS Items - COC Required - SSF 10 (CS)
    public boolean naaccr00189(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF10_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor10 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF10_COC':SSF10_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF10_COC, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor10 must not be 988')
            }
        }
        else {
            if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
                if (functions.GEN_INLIST(t_schema_name, "BileDuctsIntraHepat")) {
                    return true
                }
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                    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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
                    if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                            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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00190; TAG: N1815; NAME: CS Items - COC Required - SSF 11 (CS)
    public boolean naaccr00190(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF11_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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 ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor11 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF11_COC':SSF11_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF11_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00191; TAG: N1816; NAME: CS Items - COC Required - SSF 12 (CS)
    public boolean naaccr00191(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF12_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor12 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF12_COC':SSF12_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF12_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00192; TAG: N1817; NAME: CS Items - COC Required - SSF 13 (CS)
    public boolean naaccr00192(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF13_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor13 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF13_COC':SSF13_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF13_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00193; TAG: N1818; NAME: CS Items - COC Required - SSF 14 (CS)
    public boolean naaccr00193(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF14_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor14 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF14_COC':SSF14_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF14_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor14 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00194; TAG: N1819; NAME: CS Items - COC Required - SSF 15 (CS)
    public boolean naaccr00194(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF15_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor15 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF15_COC':SSF15_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF15_COC, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor15 must not be 988')
            }
        }
        else {
            if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
                if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                    return true
                }
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                    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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor15 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
                    if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                        if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
        
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                                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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00195; TAG: N1820; NAME: CS Items - COC Required - SSF 16 (CS)
    public boolean naaccr00195(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF16_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor16 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF16_COC':SSF16_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF16_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor16 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00196; TAG: N1821; NAME: CS Items - COC Required - SSF 17 (CS)
    public boolean naaccr00196(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF17_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor17 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF17_COC':SSF17_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF17_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor17 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00197; TAG: N1822; NAME: CS Items - COC Required - SSF 18 (CS)
    public boolean naaccr00197(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF18_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor18 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF18_COC':SSF18_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF18_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor18 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor18 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00198; TAG: N1823; NAME: CS Items - COC Required - SSF 19 (CS)
    public boolean naaccr00198(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor19)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00199; TAG: N1836; NAME: CS Items - COC Required - SSF 2 (CS)
    public boolean naaccr00199(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF2_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 2 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF2_COC':SSF2_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF2_COC, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor 2 must not be 988')
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                return true
            }
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
            return true
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "KidneyParenchyma,KidneyRenalPelvis,Lung") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva") || functions.GEN_INLIST(t_schema_name, "Ovary,PeritoneumFemaleGen,Placenta") || functions.GEN_INLIST(t_schema_name, "Pleura,SmallIntestine,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must be 988 for this schema')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum"))
                        return true
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                            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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
        
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
        
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "KidneyParenchyma,KidneyRenalPelvis,Lung") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva") || functions.GEN_INLIST(t_schema_name, "Ovary,PeritoneumFemaleGen,Placenta") || functions.GEN_INLIST(t_schema_name, "Pleura,SmallIntestine,Vagina"))
                    return true
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum"))
                        return true
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                            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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00200; TAG: N1825; NAME: CS Items - COC Required - SSF 20 (CS)
    public boolean naaccr00200(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor20)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00201; TAG: N1826; NAME: CS Items - COC Required - SSF 21 (CS)
    public boolean naaccr00201(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF21_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor21 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF21_COC':SSF21_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF21_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor21 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor21 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00202; TAG: N1827; NAME: CS Items - COC Required - SSF 22 (CS)
    public boolean naaccr00202(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF22_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor22 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF22_COC':SSF22_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF22_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor22 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor22 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00203; TAG: N1828; NAME: CS Items - COC Required - SSF 23 (CS)
    public boolean naaccr00203(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF23_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor23 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF23_COC':SSF23_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF23_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor23 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor23 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00204; TAG: N1829; NAME: CS Items - COC Required - SSF 24 (CS)
    public boolean naaccr00204(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor24)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00205; TAG: N1830; NAME: CS Items - COC Required - SSF 3 (CS)
    public boolean naaccr00205(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF3_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(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, 'For DX Year > 2003, CS Site-Specific Factor 3 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF3_COC':SSF3_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF3_COC, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor 3 must not be 988')
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                return true
            }
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
            return true
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Appendix,Bladder,Bone,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,KidneyParenchyma,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva,Ovary") || functions.GEN_INLIST(t_schema_name, "PeritoneumFemaleGen,Rectum,SkinEyelid,SmallIntestine") || functions.GEN_INLIST(t_schema_name, "SoftTissue,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Appendix,Bladder,Bone,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,KidneyParenchyma,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva,Ovary") || functions.GEN_INLIST(t_schema_name, "PeritoneumFemaleGen,Rectum,SkinEyelid,SmallIntestine") || functions.GEN_INLIST(t_schema_name, "SoftTissue,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00206; TAG: N1831; NAME: CS Items - COC Required - SSF 4 (CS)
    public boolean naaccr00206(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF4_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 4 must not be blank')
            }
        }
        if (dx_year > 2003 && dx_year < 2010) {
            if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                    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 DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
                }
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF4_COC':SSF4_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF4_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,KidneyParenchyma,LacrimalGland") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "Liver,MelanomaChoroid,MelanomaCiliaryBody") || functions.GEN_INLIST(t_schema_name, "MelanomaIris,Rectum,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,KidneyParenchyma,LacrimalGland") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "Liver,MelanomaChoroid,MelanomaCiliaryBody") || functions.GEN_INLIST(t_schema_name, "MelanomaIris,Rectum,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00207; TAG: N1832; NAME: CS Items - COC Required - SSF 5 (CS)
    public boolean naaccr00207(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF5_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 5 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF5_COC':SSF5_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF5_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTPeritoneum,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTPeritoneum,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00208; TAG: N1833; NAME: CS Items - COC Required - SSF 6 (CS)
    public boolean naaccr00208(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF6_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 6 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF6_COC':SSF6_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF6_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTEsophagus,GISTPeritoneum") || functions.GEN_INLIST(t_schema_name, "GISTSmallIntestine,GISTStomach,KidneyParenchyma") || functions.GEN_INLIST(t_schema_name, "LacrimalGland,Liver,LymphomaOcularAdnexa") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Rectum,SkinEyelid,Testis,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTEsophagus,GISTPeritoneum") || functions.GEN_INLIST(t_schema_name, "GISTSmallIntestine,GISTStomach,KidneyParenchyma") || functions.GEN_INLIST(t_schema_name, "LacrimalGland,Liver,LymphomaOcularAdnexa") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Rectum,SkinEyelid,Testis,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00209; TAG: N1834; NAME: CS Items - COC Required - SSF 7 (CS)
    public boolean naaccr00209(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF7_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 7 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF7_COC':SSF7_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF7_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00210; TAG: N1837; NAME: CS Items - COC Required - SSF 8 (CS)
    public boolean naaccr00210(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF8_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 8 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF8_COC':SSF8_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF8_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00211; TAG: N1835; NAME: CS Items - COC Required - SSF 9 (CS)
    public boolean naaccr00211(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF9_COC = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 9 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF9_COC':SSF9_COC])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF9_COC, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 9 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00212; TAG: N1593; NAME: CS Items - NPCR Required - Non-SSF (CS)
    public boolean naaccr00212(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year, err_flag
        
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.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)
            return true
        if (dx_year > 2017)
            return true
        if (functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "6,7"))
            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 (dx_year > 2003 && functions.GEN_EMPTY(untrimmedline.overRideCs20) && (dx_year < 2016)) {
        
            if (functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2003, CS Extension cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2003, CS Lymph Nodes cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2003, CS Mets at DX cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Site-Specific Factor25 cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Input Original cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Input Current cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2007 && functions.GEN_EMPTY(untrimmedline.overRideCs20) && (dx_year < 2016)) {
        
            if (functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2007, CS Tumor Size cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2007, CS Tumor Size/Ext Eval cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2011 && functions.GEN_EMPTY(untrimmedline.overRideCs20)) {
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2011, Regional Nodes Examined cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive)) {
                functions.GEN_SAVE_TEXT(binding, 'If year of DX > 2011, Regional Nodes Positive cannot be blank')
                err_flag = 1
            }
        }
        if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1") && (!functions.GEN_INLIST(untrimmedline.typeOfReportingSource, "3-7"))) {
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesExamined)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = ${untrimmedline.overRideCs20} and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, Regional Nodes Examined cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.regionalNodesPositive)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = ${untrimmedline.overRideCs20} and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, Regional Nodes Positive cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = ${untrimmedline.overRideCs20} and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Tumor Size cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = ${untrimmedline.overRideCs20} and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Version Input Original cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = ${untrimmedline.overRideCs20} and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Version Input Current cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If Over-ride CS 20 = ${untrimmedline.overRideCs20} and Type of Reporting Source = ${untrimmedline.typeOfReportingSource}, CS Site-Specific Factor25 cannot be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-00234; TAG: N2095; NAME: CS Items - NPCR Required - SSF 7 (CS)
    public boolean naaccr00234(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_INLIST(untrimmedline.overRideCs20, "1"))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            return true
        if (dx_year > 2015)
            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
            }
        }
        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.csSiteSpecificFactor7)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 7 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00237; TAG: N1500; NAME: CS Items - Required for Staging - SSF 1 (NAACCR)
    public boolean naaccr00237(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF1_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 1 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF1_STG':SSF1_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF1_STG, "R")) {
            return true
        }
        if ((dx_year > 2009) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20001)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Conjunctiva,Esophagus,HeartMediastinum,Lung") || functions.GEN_INLIST(t_schema_name, "Peritoneum,Retroperitoneum,SoftTissue")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must be 988 for this schema')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Stomach,EsophagusGEJunction,NETStomach")) {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
                            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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be blank')
                        }
                    }
                    else {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                            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 DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Conjunctiva,Esophagus,HeartMediastinum,Lung") || functions.GEN_INLIST(t_schema_name, "Peritoneum,Retroperitoneum,SoftTissue")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be blank')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Stomach,EsophagusGEJunction,NETStomach")) {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1))
                            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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be blank')
                        }
                    }
                    else {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                            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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00238; TAG: N1520; NAME: CS Items - Required for Staging - SSF 10 (NAACCR)
    public boolean naaccr00238(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF10_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor10 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF10_STG':SSF10_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF10_STG, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor10 must not be 988')
            }
        }
        else {
            if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
                if (functions.GEN_INLIST(t_schema_name, "BileDuctsIntraHepat")) {
                    return true
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                    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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
                    if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                            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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                        }
                    }
                    else {
        
                        if (functions.GEN_INLIST(t_schema_name, "BileDuctsIntraHepat"))
                            return true
                        if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10))
                                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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must not be blank')
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00239; TAG: N1521; NAME: CS Items - Required for Staging - SSF 11 (NAACCR)
    public boolean naaccr00239(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF11_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR)) {
            return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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 ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor11 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF11_STG':SSF11_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF11_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
        
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                }
            }
            else {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00240; TAG: N1522; NAME: CS Items - Required for Staging - SSF 12 (NAACCR)
    public boolean naaccr00240(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF12_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor12 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF12_STG':SSF12_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF12_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00241; TAG: N1524; NAME: CS Items - Required for Staging - SSF 13 (NAACCR)
    public boolean naaccr00241(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF13_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor13 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF13_STG':SSF13_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF13_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00242; TAG: N1511; NAME: CS Items - Required for Staging - SSF 14 (NAACCR)
    public boolean naaccr00242(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor14)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor14 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00243; TAG: N1526; NAME: CS Items - Required for Staging - SSF 15 (NAACCR)
    public boolean naaccr00243(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF15_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor15 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF15_STG':SSF15_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF15_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor15 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00244; TAG: N1528; NAME: CS Items - Required for Staging - SSF 16 (NAACCR)
    public boolean naaccr00244(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF16_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor16 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF16_STG':SSF16_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF16_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor16 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00245; TAG: N1527; NAME: CS Items - Required for Staging - SSF 17 (NAACCR)
    public boolean naaccr00245(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF17_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor17 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF17_STG':SSF17_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF17_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor17 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00246; TAG: N1512; NAME: CS Items - Required for Staging - SSF 18 (NAACCR)
    public boolean naaccr00246(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor18)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor18 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00247; TAG: N1513; NAME: CS Items - Required for Staging - SSF 19 (NAACCR)
    public boolean naaccr00247(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor19)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor19 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00248; TAG: N1501; NAME: CS Items - Required for Staging - SSF 2 (NAACCR)
    public boolean naaccr00248(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF2_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 2 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF2_STG':SSF2_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF2_STG, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor 2 must not be 988')
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
        
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva") || functions.GEN_INLIST(t_schema_name, "SmallIntestine")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must be 988 for this schema')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum")) {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
                            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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be blank for this schema')
                        }
                    }
                    else {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                            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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be blank or 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
        
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
        
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva") || functions.GEN_INLIST(t_schema_name, "SmallIntestine")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be blank')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum")) {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2))
                            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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be blank')
                        }
                    }
                    else {
                        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                            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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00249; TAG: N1514; NAME: CS Items - Required for Staging - SSF 20 (NAACCR)
    public boolean naaccr00249(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor20)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor20 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00250; TAG: N1515; NAME: CS Items - Required for Staging - SSF 21 (NAACCR)
    public boolean naaccr00250(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor21 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00251; TAG: N1516; NAME: CS Items - Required for Staging - SSF 22 (NAACCR)
    public boolean naaccr00251(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor22)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor22 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00252; TAG: N1517; NAME: CS Items - Required for Staging - SSF 23 (NAACCR)
    public boolean naaccr00252(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor23)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor23 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00253; TAG: N1518; NAME: CS Items - Required for Staging - SSF 24 (NAACCR)
    public boolean naaccr00253(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor24)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor24 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00254; TAG: N1503; NAME: CS Items - Required for Staging - SSF 3 (NAACCR)
    public boolean naaccr00254(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF3_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(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, 'For DX Year > 2003, CS Site-Specific Factor 3 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF3_STG':SSF3_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF3_STG, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor 3 must not be 988')
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
        
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be blank or 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be blank')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00255; TAG: N1504; NAME: CS Items - Required for Staging - SSF 4 (NAACCR)
    public boolean naaccr00255(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF4_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 4 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF4_STG':SSF4_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF4_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be blank or 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be blank')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00256; TAG: N1506; NAME: CS Items - Required for Staging - SSF 5 (NAACCR)
    public boolean naaccr00256(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF5_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 5 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF5_STG':SSF5_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF5_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be blank or 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "GISTPeritoneum")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be blank')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00257; TAG: N1507; NAME: CS Items - Required for Staging - SSF 6 (NAACCR)
    public boolean naaccr00257(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF6_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 6 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF6_STG':SSF6_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF6_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTSmallIntestine,GISTStomach") || functions.GEN_INLIST(t_schema_name, "SkinEyelid")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be blank or 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "GISTEsophagus,GISTSmallIntestine,GISTStomach") || functions.GEN_INLIST(t_schema_name, "SkinEyelid")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be blank')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00258; TAG: N1508; NAME: CS Items - Required for Staging - SSF 7 (NAACCR)
    public boolean naaccr00258(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF7_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 7 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF7_STG':SSF7_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF7_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00259; TAG: N1509; NAME: CS Items - Required for Staging - SSF 8 (NAACCR)
    public boolean naaccr00259(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF8_STG = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if ((dx_year > 2003)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 8 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF_2, context.NAACCR_CS_SSF_2_SCHEMA, ['SCHEMA':schema, 'SSF8_STG':SSF8_STG])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF8_STG, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must not be blank')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00260; TAG: N1510; NAME: CS Items - Required for Staging - SSF 9 (NAACCR)
    public boolean naaccr00260(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent))
            return true
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (dx_year < 2004)
            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
            }
        }
        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.csSiteSpecificFactor9)) {
            functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 9 must not be blank')
        }
        return true

    }

    // ID: NAACCR-00261; TAG: N2353; NAME: CS Items - SEER Required - Non-SSF (CS)
    public boolean naaccr00261(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY) || dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return true
        if (functions.GEN_INLIST(untrimmedline.registryId, "0000001562", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)"))
            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 (dx_year > 2003 && dx_year < 2016) {
        
            if (functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Tumor Size cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Extension cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Lymph Nodes cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Mets at DX cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Input Original cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Version Input Current cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year > 2007 && dx_year < 2016) {
            if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Tumor Size/Ext Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Lymph Nodes Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2003, CS Mets Eval cannot be blank')
                err_flag = 1
            }
        }
        if ((dx_year > 2003 && dx_year < 2008) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20100)) {
            if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If CS Version Input Orig > or = 020100, CS Tumor Size/Ext Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If CS Version Input Orig > or = 020100, CS Lymph Nodes Eval cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If CS Version Input Orig > or = 020100, CS Mets Eval cannot be blank')
                err_flag = 1
            }
        }
        if ((dx_year > 2009 && dx_year < 2016) && !functions.GEN_INLIST(untrimmedline.registryId, "0000001563", "(\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d)")) {
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009 and <2016, CS Mets at DX-Bone cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009 and <2016, CS Mets at DX-Brain cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009 and <2016, CS Mets at DX-Liver cannot be blank')
                err_flag = 1
            }
            if (functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2009 and <2016, CS Mets at DX-Lung cannot be blank')
                err_flag = 1
            }
        }
        if (dx_year == 2016 || dx_year == 2017) {
        
            if (!functions.GEN_EMPTY(untrimmedline.csExtension)) {
                if (functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Tumor Size cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Tumor Size/Ext Eval cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Lymph Nodes cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Lymph Nodes Eval cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Mets at DX cannot be blank')
                    err_flag = 1
                }
                if (functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Mets Eval cannot be blank')
                    err_flag = 1
                }
            }
            if (functions.GEN_EMPTY(untrimmedline.csExtension)) {
                if (!functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Tumor Size must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Tumor Size/Ext Eval must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Lymph Nodes must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Lymph Nodes Eval must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Mets at DX must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Mets Eval must be blank')
                    err_flag = 1
                }
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Bone must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Brain must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Liver must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX > 2015, CS Mets at DX-Lung must be blank')
                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-00262; TAG: N2355; NAME: CS Items - SEER Required - SSF 1 (CS)
    public boolean naaccr00262(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF1_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent) && (dx_year < 2016))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) && (dx_year < 2016))
            return true
        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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland")) {
                return true
            }
        }
        if ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 1 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF1_SEER':SSF1_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF1_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension))) {
            if (functions.GEN_INLIST(SSF1_SEER, "R")) {
                if ((functions.GEN_INLIST(t_schema_name, "Retinoblastoma,Esophagus,EsophagusGEJunction,NETStomach,Stomach"))) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988")) {
                        return true
                    }
                }
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2003) && (dx_year < 2016)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) || ((dx_year > 2013) && (dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!functions.GEN_EMPTY(untrimmedline.csExtension)))) {
            if (functions.GEN_INLIST(SSF1_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if (((dx_year > 2009) && (dx_year < 2014)) || ((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,Cervix,Conjunctiva,CorpusAdenosarcoma") || functions.GEN_INLIST(t_schema_name, "CorpusCarcinoma,CorpusSarcoma,Esophagus,FallopianTube") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,HemeRetic,KidneyParenchyma,KidneyRenalPelvis") || functions.GEN_INLIST(t_schema_name, "Lung,MerkelCellPenis,MerkelCellScrotum    ,MerkelCellSkin,MerkelCellVulva") || functions.GEN_INLIST(t_schema_name, "Peritoneum,PeritoneumFemaleGen,Retroperitoneum,Scrotum") || functions.GEN_INLIST(t_schema_name, "Skin,SmallIntestine,SoftTissue,Urethra,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must be 988 for this schema')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Stomach,EsophagusGEJunction,NETStomach"))
                        return true
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                            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 DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 1 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,Cervix,Conjunctiva,CorpusAdenosarcoma") || functions.GEN_INLIST(t_schema_name, "CorpusCarcinoma,CorpusSarcoma,Esophagus,FallopianTube") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,HemeRetic,KidneyParenchyma,KidneyRenalPelvis") || functions.GEN_INLIST(t_schema_name, "Lung,MerkelCellPenis,MerkelCellScrotum    ,MerkelCellSkin,MerkelCellVulva") || functions.GEN_INLIST(t_schema_name, "Peritoneum,PeritoneumFemaleGen,Retroperitoneum,Scrotum") || functions.GEN_INLIST(t_schema_name, "Skin,SmallIntestine,SoftTissue,Urethra,Vagina") || functions.GEN_INLIST(t_schema_name, "Stomach,EsophagusGEJunction,NETStomach"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 1 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00263; TAG: N2370; NAME: CS Items - SEER Required - SSF 10 (CS)
    public boolean naaccr00263(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF10_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor10 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF10_SEER':SSF10_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF10_SEER, "N,R")) {
            return true
        }
        if (dx_year > 2015 && functions.GEN_EMPTY(untrimmedline.csExtension)) {
            if (functions.GEN_INLIST(SSF10_SEER, "R")) {
                if (functions.GEN_INLIST(t_schema_name, "BileDuctsIntraHepat")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                        return true
                }
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
                else
                    return true
            }
        }
        if (((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550) && (dx_year > 2003 && dx_year < 2016)) || ((dx_year > 2013) && (dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!(functions.GEN_EMPTY(untrimmedline.csExtension))))) {
            if (functions.GEN_INLIST(SSF10_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2010 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
            }
        }
        else {
            if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
                if (functions.GEN_INLIST(t_schema_name, "BileDuctsIntraHepat")) {
                    return true
                }
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                    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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor10 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
                    if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988"))
                            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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor10 must be 988 for this schema')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00264; TAG: N2155; NAME: CS Items - SEER Required - SSF 11 (CS)
    public boolean naaccr00264(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF11_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016)) {
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor11 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF11_SEER':SSF11_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF11_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF11_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor11 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor11 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00265; TAG: N2156; NAME: CS Items - SEER Required - SSF 12 (CS)
    public boolean naaccr00265(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF12_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor12 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF12_SEER':SSF12_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF12_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF12_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor12 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor12 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00266; TAG: N2157; NAME: CS Items - SEER Required - SSF 13 (CS)
    public boolean naaccr00266(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF13_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor13 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF13_SEER':SSF13_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF13_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF13_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor13 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor13 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00267; TAG: N2158; NAME: CS Items - SEER Required - SSF 14 (CS)
    public boolean naaccr00267(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF14_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor14 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF14_SEER':SSF14_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF14_SEER, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor14 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor14 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00268; TAG: N2159; NAME: CS Items - SEER Required - SSF 15 (CS)
    public boolean naaccr00268(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF15_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor15 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF15_SEER':SSF15_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF15_SEER, "R")) {
            return true
        }
        if ((dx_year > 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                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 DX Year > 2010 OR CS Version Input Original > or = 020302, CS Site-Specific Factor15 must not be 988')
            }
        }
        else {
            if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
                if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                    return true
                }
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                    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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor15 must not be 988 for this schema')
                }
            }
            else {
                if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
                    if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                        if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
        
                            if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988"))
                                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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor15 must be 988 for this schema')
                            }
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00269; TAG: N2160; NAME: CS Items - SEER Required - SSF 16 (CS)
    public boolean naaccr00269(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF16_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor16 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF16_SEER':SSF16_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF16_SEER, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor16 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor16 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00270; TAG: N2161; NAME: CS Items - SEER Required - SSF 17 (CS)
    public boolean naaccr00270(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF17_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor17 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF17_SEER':SSF17_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF17_SEER, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor17 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor17 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00271; TAG: N2162; NAME: CS Items - SEER Required - SSF 18 (CS)
    public boolean naaccr00271(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF18_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor18 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF18_SEER':SSF18_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF18_SEER, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor18 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor18 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00272; TAG: N2163; NAME: CS Items - SEER Required - SSF 19 (CS)
    public boolean naaccr00272(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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)
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor19 must not be blank')
            }
        }
        return true

    }

    // ID: NAACCR-00273; TAG: N2368; NAME: CS Items - SEER Required - SSF 2 (CS)
    public boolean naaccr00273(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF2_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputCurrent) && (dx_year < 2016))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 2 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF2_SEER':SSF2_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF2_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension))) {
            if (functions.GEN_INLIST(SSF2_SEER, "R")) {
                if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum,SmallIntestine")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988")) {
                        return true
                    }
                }
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2003) && (dx_year < 2016)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) || ((dx_year > 2013) && (dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!functions.GEN_EMPTY(untrimmedline.csExtension)))) {
            if (functions.GEN_INLIST(SSF2_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((dx_year > 2010 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(t_schema_name, "BileDuctsIntraHepat,KidneyRenalPelvis,Liver")) {
                if (!functions.GEN_INLIST(t_schema_name, "Ovary,PeritoneumFemaleGen,Placenta,Vagina")) {
                    if (functions.GEN_INLIST(SSF2_SEER, "R")) {
                        if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
                        }
                        else
                            return true
                    }
                }
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                return true
            }
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
            return true
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "KidneyParenchyma,KidneyRenalPelvis,Lung") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva") || functions.GEN_INLIST(t_schema_name, "Ovary,PeritoneumFemaleGen,Placenta") || functions.GEN_INLIST(t_schema_name, "Pleura,SmallIntestine,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must be 988 for this schema')
                    }
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum"))
                        return true
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                            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 DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 2 must not be 988 for this schema')
                        }
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "KidneyParenchyma,KidneyRenalPelvis,Lung") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaConjunctiva") || functions.GEN_INLIST(t_schema_name, "Ovary,PeritoneumFemaleGen,Placenta") || functions.GEN_INLIST(t_schema_name, "Pleura,SmallIntestine,Vagina"))
                    return true
                else {
                    if (functions.GEN_INLIST(t_schema_name, "Appendix,CarcinoidAppendix,Colon,NETColon,NETRectum,Rectum"))
                        return true
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988"))
                            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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 2 must not be 988')
                        }
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00274; TAG: N2167; NAME: CS Items - SEER Required - SSF 20 (CS)
    public boolean naaccr00274(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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)
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor20 must not be blank')
            }
        }
        return true

    }

    // ID: NAACCR-00275; TAG: N2168; NAME: CS Items - SEER Required - SSF 21 (CS)
    public boolean naaccr00275(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF21_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor21 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF21_SEER':SSF21_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF21_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF21_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor21 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor21 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor21 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00276; TAG: N2169; NAME: CS Items - SEER Required - SSF 22 (CS)
    public boolean naaccr00276(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF22_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor22 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF22_SEER':SSF22_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF22_SEER, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor22 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor22 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00277; TAG: N2170; NAME: CS Items - SEER Required - SSF 23 (CS)
    public boolean naaccr00277(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF23_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor23 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF23_SEER':SSF23_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF23_SEER, "R")) {
            return true
        }
        if ((dx_year >= 2010) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) > 20000)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor23 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor23 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00278; TAG: N2171; NAME: CS Items - SEER Required - SSF 24 (CS)
    public boolean naaccr00278(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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)
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor24 must not be blank')
            }
        }
        return true

    }

    // ID: NAACCR-00279; TAG: N2369; NAME: CS Items - SEER Required - SSF 3 (CS)
    public boolean naaccr00279(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF3_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent) && (dx_year < 2016))
            return true
        if (functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal) && (dx_year < 2016)) {
            return true
        }
        if ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(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, 'For DX Year > 2003, CS Site-Specific Factor 3 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF3_SEER':SSF3_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF3_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2015) && (functions.GEN_EMPTY(untrimmedline.csExtension))) {
            if (functions.GEN_INLIST(SSF3_SEER, "R")) {
                if ((functions.GEN_INLIST(t_schema_name, "LacrimalGland,MelanomaSkin,MerkelCellPenis,MerkelCellScrotum")) || (functions.GEN_INLIST(t_schema_name, "MerkelCellSkin,MerkelCellVulva,Prostate,SkinEyelid"))) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        return true /* must not be 988 */
                }
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
                }
                else
                    return true
            }
            else {
                return true
            }
        }
        if (((functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550) && ((dx_year > 2003) && (dx_year < 2016))) || ((dx_year > 2013 && dx_year < 2016)) || ((dx_year == 2016 || dx_year == 2017) && (!functions.GEN_EMPTY(untrimmedline.csExtension)))) {
            if (functions.GEN_INLIST(SSF3_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((dx_year > 2010 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20302)) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
            }
        }
        if ((dx_year == 2010) || (functions.GEN_INLIST(untrimmedline.csVersionInputOriginal, "0201,0202", "(\\d\\d\\d\\d\\d\\d)", 1, 4))) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                return true
            }
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                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 DX Year > 2009 OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 3 must not be 988 for this schema')
            }
        }
        if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
            return true
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Appendix,Bladder,Bone,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,KidneyParenchyma,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva,Ovary") || functions.GEN_INLIST(t_schema_name, "PeritoneumFemaleGen,Rectum,SkinEyelid,SmallIntestine") || functions.GEN_INLIST(t_schema_name, "SoftTissue,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Appendix,Bladder,Bone,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "HeartMediastinum,KidneyParenchyma,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "MerkelCellScrotum,MerkelCellSkin,MerkelCellVulva,Ovary") || functions.GEN_INLIST(t_schema_name, "PeritoneumFemaleGen,Rectum,SkinEyelid,SmallIntestine") || functions.GEN_INLIST(t_schema_name, "SoftTissue,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 3 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00280; TAG: N2177; NAME: CS Items - SEER Required - SSF 4 (CS)
    public boolean naaccr00280(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF4_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 4 must not be blank')
            }
        }
        if (dx_year > 2003 && dx_year < 2010) {
            if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                    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 DX Year < 2010 and CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
                }
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF4_SEER':SSF4_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF4_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF4_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 4 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,KidneyParenchyma,LacrimalGland") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "Liver,MelanomaChoroid,MelanomaCiliaryBody") || functions.GEN_INLIST(t_schema_name, "MelanomaIris,Rectum,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,KidneyParenchyma,LacrimalGland") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MerkelCellPenis") || functions.GEN_INLIST(t_schema_name, "Liver,MelanomaChoroid,MelanomaCiliaryBody") || functions.GEN_INLIST(t_schema_name, "MelanomaIris,Rectum,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 4 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00281; TAG: N2178; NAME: CS Items - SEER Required - SSF 5 (CS)
    public boolean naaccr00281(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF5_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 5 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF5_SEER':SSF5_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF5_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF5_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 5 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTPeritoneum,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTPeritoneum,Liver,MelanomaChoroid") || functions.GEN_INLIST(t_schema_name, "MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 5 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00282; TAG: N2179; NAME: CS Items - SEER Required - SSF 6 (CS)
    public boolean naaccr00282(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF6_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 6 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF6_SEER':SSF6_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF6_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF6_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 6 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTEsophagus,GISTPeritoneum") || functions.GEN_INLIST(t_schema_name, "GISTSmallIntestine,GISTStomach,KidneyParenchyma") || functions.GEN_INLIST(t_schema_name, "LacrimalGland,Liver,LymphomaOcularAdnexa") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Rectum,SkinEyelid,Testis,Vagina")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must be 988 for this schema')
                    }
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988 for this schema')
                    }
                }
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) > 20510) {
                if (functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,Colon") || functions.GEN_INLIST(t_schema_name, "CorpusAdenosarcoma,CorpusCarcinoma,CorpusSarcoma") || functions.GEN_INLIST(t_schema_name, "FallopianTube,GISTEsophagus,GISTPeritoneum") || functions.GEN_INLIST(t_schema_name, "GISTSmallIntestine,GISTStomach,KidneyParenchyma") || functions.GEN_INLIST(t_schema_name, "LacrimalGland,Liver,LymphomaOcularAdnexa") || functions.GEN_INLIST(t_schema_name, "MelanomaChoroid,MelanomaCiliaryBody,MelanomaIris,MelanomaSkin") || functions.GEN_INLIST(t_schema_name, "NETAmpulla,Rectum,SkinEyelid,Testis,Vagina"))
                    return true
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "988"))
                        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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()}, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 6 must not be 988')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00283; TAG: N2180; NAME: CS Items - SEER Required - SSF 7 (CS)
    public boolean naaccr00283(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF7_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 7 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF7_SEER':SSF7_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF7_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF7_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 7 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 7 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00284; TAG: N2181; NAME: CS Items - SEER Required - SSF 8 (CS)
    public boolean naaccr00284(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF8_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 8 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF8_SEER':SSF8_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF8_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF8_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 8 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988"))
                    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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 8 must be 988 for this schema')
                }
            }
        }
        return true

    }

    // ID: NAACCR-00285; TAG: N2182; NAME: CS Items - SEER Required - SSF 9 (CS)
    public boolean naaccr00285(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] schema = new char[34], SSF9_SEER = new char[2]
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year
        
        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.csVersionInputOriginal) || functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) && (dx_year < 2016))
            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 ((dx_year > 2003 && dx_year < 2018)) {
            if (functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) {
                functions.GEN_STRCPY(t_schema_msg, "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 DX Year > 2003, CS Site-Specific Factor 9 must not be blank')
            }
        }
        if (!functions.GEN_LOOKUP((t_schema_name), context.NAACCR_CS_SSF, context.NAACCR_CS_SSF_SCHEMA, ['SCHEMA':schema, 'SSF9_SEER':SSF9_SEER])) {
            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_ERROR_TEXT(binding, 'Schema missing in SSF table')
            return false
        }
        if (!functions.GEN_INLIST(SSF9_SEER, "N,R")) {
            return true
        }
        if ((dx_year > 2013) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20550)) {
            if (functions.GEN_INLIST(SSF9_SEER, "R")) {
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "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 functions.GEN_ERROR_MSG(binding, 'For Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 9 must not be 988 for this schema')
                }
                else
                    return true
            }
            else
                return true
        }
        if ((((dx_year > 2009 && dx_year < 2014) || (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) >= 20000)) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20550))) {
            if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
                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 Date of Diagnosis of ${untrimmedline.dateOfDiagnosis.formatDate()} OR CS Version Input Original of ${untrimmedline.csVersionInputOriginal}, CS Site-Specific Factor 9 must not be 988 for this schema')
            }
        }
        if ((dx_year > 2003) && (dx_year < 2010) && (functions.GEN_VAL(untrimmedline.csVersionInputOriginal) < 20000)) {
            if (functions.GEN_VAL(untrimmedline.csVersionInputCurrent) == 20510) {
                if (!functions.GEN_INLIST(t_schema_name, "Breast")) {
                    if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988"))
                        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 DX Year < 2010, CS Version Input Original of ${untrimmedline.csVersionInputOriginal} and CS Version Input Current of ${untrimmedline.csVersionInputCurrent}, CS Site-Specific Factor 9 must be 988 for this schema')
                    }
                }
            }
        }
        return true

    }

    // ID: NAACCR-00286; TAG: N0697; NAME: CS Items, DX Pre-2004 (CS)
    public boolean naaccr00286(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        int dx_year
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (dx_year < 2004) {
            if (!functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Tumor Size must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Extension must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Tumor Size/Ext Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Lymph Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Reg Nodes Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Mets at DX must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Mets Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 1 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 2 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 3 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 4 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 5 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 6 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 7 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 8 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 9 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor10 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor11 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor12 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor13 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor14 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor15 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor16 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor17 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor18 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor19 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor20 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor21 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor22 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor23 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor24 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor25 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Version Input Original must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Version Input Current must be blank')
                err_flag = 1
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-00287; TAG: N2438; NAME: CS Items, DX Pre-2004 (SEER)
    public boolean naaccr00287(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
        int err_flag
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_ERROR))
            return functions.GEN_ERROR_TEXT(binding, 'Date of Diagnosis: %DC')
        if (dx_year == ((Integer)context.NAACCR_GEN_DT_EMPTY))
            return true
        if (functions.GEN_EMPTY(untrimmedline.histologicTypeIcdO3))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        if (dx_year < 2004) {
            if (!functions.GEN_EMPTY(untrimmedline.csTumorSize)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Tumor Size must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csExtension)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Extension must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Tumor Size/Ext Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Lymph Nodes must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Reg Nodes Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Mets at DX must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csMetsEval)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Mets Eval must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 1 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 2 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 3 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 4 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 5 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 6 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 7 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 8 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor10 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor12 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor13 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor16 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor17 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor18 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor19 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor20 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor21 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor22 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor23 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor24 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor25)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor25 must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionInputOriginal)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Version Input Original must be blank')
                err_flag = 1
            }
            if (!functions.GEN_EMPTY(untrimmedline.csVersionInputCurrent)) {
                functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Version Input Current must be blank')
                err_flag = 1
            }
            if (!functions.GEN_INLIST(untrimmedline.primarySite, "C500,C501,C502,C503,C504,C505,C506,C507,C508,C509")) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor 9 must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor11 must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor14 must be blank')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15)) {
                    functions.GEN_SAVE_TEXT(binding, 'If DX < 2004, CS Site-Specific Factor15 must be blank')
                    err_flag = 1
                }
            }
            if (functions.GEN_INLIST(untrimmedline.primarySite, "C500,C501,C502,C503,C504,C505,C506,C507,C508,C509")) {
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "010,020,030,997,998,999")) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Site-Specific Factor 9 is invalid')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "010,020,030,997,998,999")) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Site-Specific Factor11 is invalid')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "010,020,030,997,998,999")) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Site-Specific Factor14 is invalid')
                    err_flag = 1
                }
                if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "010,020,030,997,998,999")) {
                    functions.GEN_SAVE_TEXT(binding, 'CS Site-Specific Factor15 is invalid')
                    err_flag = 1
                }
            }
        }
        if (err_flag == 1)
            return false
        return true

    }

    // ID: NAACCR-00288; TAG: N1537; NAME: CS Items, Type Reporting Source-DCO (CS)
    public boolean naaccr00288(Binding binding, Map context, MetafileContextFunctions functions, List> untrimmedlines, Map untrimmedline) throws Exception {
        functions.GEN_RESET_LOCAL_CONTEXT(binding)
        
        char[] t_site = new char[5], t_hist = new char[5], t_discrim = new char[4], t_schema_name = new char[31], t_schema_msg = new char[79]
        int t_schema_number, t_max_schemas, t_result
        int dx_year, err_flag
        
        err_flag = 0
        
        dx_year = functions.GEN_DATE_YEAR_IOP(binding, untrimmedline.dateOfDiagnosis)
        
        if (dx_year == ((Integer)context.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_INLIST(untrimmedline.typeOfReportingSource, "7"))
            return true
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "2"))
            return true
        functions.GEN_STRCPY(t_site, untrimmedline.primarySite)
        functions.GEN_STRCPY(t_hist, untrimmedline.histologicTypeIcdO3)
        functions.GEN_STRCPY(t_discrim, untrimmedline.csSiteSpecificFactor25)
        
        t_max_schemas = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_number_of_schemas")
        
        t_schema_number = functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_number", t_site, t_hist, t_discrim)
        
        if (t_schema_number < 0)
            return true
        if (t_schema_number > t_max_schemas) {
            return true
        }
        functions.GEN_EXTERNALDLL("cstage0205.dll", "CStage_get_schema_name", t_schema_number, t_schema_name)
        
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_INLIST(t_schema_name, "Brain,CNSOther,IntracranialGland"))
                return true
        }
        if (!functions.GEN_EMPTY(untrimmedline.csTumorSize) && !functions.GEN_INLIST(untrimmedline.csTumorSize, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Tumor Size (${untrimmedline.csTumorSize}) must = 988 or 999')
        if (functions.GEN_INLIST(untrimmedline.behaviorCodeIcdO3, "0,1,")) {
            if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "050,999"))
                functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 050 or 999')
            else
                functions.GEN_NOOP()
        }
        else {
            if (functions.GEN_INLIST(t_schema_name, "HemeRetic")) {
                if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "800,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 800 or 999')
                else
                    functions.GEN_NOOP()
            }
            else {
                if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                    if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "800,810,820,999"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 800, 810, 820, or 999')
                    else
                        functions.GEN_NOOP()
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "LymphomaOcularAdnexa")) {
                        if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "989,999"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 989 or 999')
                        else
                            functions.GEN_NOOP()
                    }
                    else {
                        if (!functions.GEN_EMPTY(untrimmedline.csExtension) && !functions.GEN_INLIST(untrimmedline.csExtension, "988,999"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Extension (${untrimmedline.csExtension}) must = 988 or 999')
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csTumorSizeExtEval) && !functions.GEN_INLIST(untrimmedline.csTumorSizeExtEval, "9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Tumor Size/Ext Eval (${untrimmedline.csTumorSizeExtEval}) must = 9')
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodes)) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "987,988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Lymph Nodes (${untrimmedline.csLymphNodes}) must = 987, 988, or 999')
                else
                    functions.GEN_NOOP()
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.csLymphNodes, "988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Lymph Nodes (${untrimmedline.csLymphNodes}) must = 988 or 999')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csLymphNodesEval) && !functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Lymph Nodes Eval (${untrimmedline.csLymphNodesEval}) must = 9')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDx) && !functions.GEN_INLIST(untrimmedline.csMetsAtDx, "98,99"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets at DX (${untrimmedline.csMetsAtDx}) must = 98 or 99')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsEval) && !functions.GEN_INLIST(untrimmedline.csMetsEval, "9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets Eval (${untrimmedline.csMetsEval}) must = 9')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor1)) {
            if (functions.GEN_INLIST(t_schema_name, "Retinoblastoma")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "960"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1}) must = 960')
            }
            else {
                if (functions.GEN_INLIST(t_schema_name, "Bladder,KidneyRenalPelvis,Urethra")) {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "987,988,999"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1}) must = 987, 988 or 999')
                }
                else {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor1, "988,999"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 1 (${untrimmedline.csSiteSpecificFactor1}) must = 988 or 999')
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor2)) {
            if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder,SkinEyelid")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "987,988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 2 (${untrimmedline.csSiteSpecificFactor2}) must = 987, 988, or 999')
                else
                    functions.GEN_NOOP()
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor2, "988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 2 (${untrimmedline.csSiteSpecificFactor2}) must = 988 or 999')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor3)) {
            if (functions.GEN_INLIST(t_schema_name, "Breast")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988,099"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}) must = 988 or 099')
            }
            else {
                if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                    if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "960"))
                        functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}) must = 960')
                }
                else {
                    if (functions.GEN_INLIST(t_schema_name, "MyelomaPlasmaCellDisorder")) {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "987,988,999"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}) must = 987, 988, or 999')
                    }
                    else {
                        if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "988,999"))
                            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 3 (${untrimmedline.csSiteSpecificFactor3}) must = 988 or 999')
                    }
                }
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor4)) {
            if (functions.GEN_INLIST(t_schema_name, "Prostate")) {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "550,988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}) must = 550, 988, or 999')
            }
            else {
                if (!functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor4, "987,988,999"))
                    functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 4 (${untrimmedline.csSiteSpecificFactor4}) must = 987, 988, or 999')
            }
        }
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor5) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor5, "987,988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 5 (${untrimmedline.csSiteSpecificFactor5}) must = 987, 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor6) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor6, "987,988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 6 (${untrimmedline.csSiteSpecificFactor6}) must = 987, 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor7) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor7, "987,988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 7 (${untrimmedline.csSiteSpecificFactor7}) must = 987, 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor8) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor8, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 8 (${untrimmedline.csSiteSpecificFactor8}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor9) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor9, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor 9 (${untrimmedline.csSiteSpecificFactor9}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor10) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor10, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor10 (${untrimmedline.csSiteSpecificFactor10}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor11) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor11, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor11 (${untrimmedline.csSiteSpecificFactor11}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor12) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor12, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor12 (${untrimmedline.csSiteSpecificFactor12}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor13) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor13, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor13 (${untrimmedline.csSiteSpecificFactor13}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor14) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor14, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor14 (${untrimmedline.csSiteSpecificFactor14}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor15) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor15, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor15 (${untrimmedline.csSiteSpecificFactor15}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor16) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor16, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor16 (${untrimmedline.csSiteSpecificFactor16}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor17) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor17, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor17 (${untrimmedline.csSiteSpecificFactor17}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor18) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor18, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor18 (${untrimmedline.csSiteSpecificFactor18}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor19) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor19, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor19 (${untrimmedline.csSiteSpecificFactor19}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor20) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor20, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor20 (${untrimmedline.csSiteSpecificFactor20}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor21) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor21, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor21 (${untrimmedline.csSiteSpecificFactor21}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor22) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor22, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor22 (${untrimmedline.csSiteSpecificFactor22}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor23) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor23, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor23 (${untrimmedline.csSiteSpecificFactor23}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csSiteSpecificFactor24) && !functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor24, "988,999"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Site-Specific Factor24 (${untrimmedline.csSiteSpecificFactor24}) must = 988 or 999')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBone) && !functions.GEN_INLIST(untrimmedline.csMetsAtDxBone, "8,9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets at Dx-Bone (${untrimmedline.csMetsAtDxBone}) must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxBrain) && !functions.GEN_INLIST(untrimmedline.csMetsAtDxBrain, "8,9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets at Dx-Brain (${untrimmedline.csMetsAtDxBrain}) must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLiver) && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLiver, "8,9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets at Dx-Liver (${untrimmedline.csMetsAtDxLiver}) must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.csMetsAtDxLung) && !functions.GEN_INLIST(untrimmedline.csMetsAtDxLung, "8,9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: CS Mets at Dx-Lung (${untrimmedline.csMetsAtDxLung}) must = 8, 9, or blank')
        if (!functions.GEN_EMPTY(untrimmedline.lymphVascularInvasion) && !functions.GEN_INLIST(untrimmedline.lymphVascularInvasion, "8,9"))
            functions.GEN_SAVE_ERROR_TEXT(binding, 'DCO: Lymphovascular Invasion (${untrimmedline.lymphVascularInvasion}) must = 8, 9, or blank')
        
        return true

    }

    // ID: NAACCR-00289; TAG: N1716; NAME: CS LN, Nodes Eval, SSF 3, MelanomaSkin (CS)
    public boolean naaccr00289(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.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.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: CS Lymph Nodes, CS Lymph Nodes Eval')
            }
        }
        if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "100-118,121-123,125-128,152-153")) {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0, 1, 5, 9")) {
        
                if (functions.GEN_INLIST(untrimmedline.csSiteSpecificFactor3, "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')
                }
            }
        }
        else {
            if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "124,158")) {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodesEval, "0, 1, 5, 9")) {
        
                    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')
                    }
                }
            }
            else {
                if (functions.GEN_INLIST(untrimmedline.csLymphNodes, "155")) {
                    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-00290; TAG: N1717; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellPenis (CS)
    public boolean naaccr00290(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, "MerkelCellPenis"))
            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,100-400,500")) {
            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, "100-400,500")) {
            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-00291; TAG: N1718; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellScrotum (CS)
    public boolean naaccr00291(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, "MerkelCellScrotum"))
            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,100-360")) {
            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, "100-360")) {
            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-00292; TAG: N1719; NAME: CS LN, Nodes Eval, SSF 3, MerkelCellSkin (CS)
    public boolean naaccr00292(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, "MerkelCellSkin"))
            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,100-360")) {
            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, "100-360")) {
            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

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy